Files
nebula.js/commands/serve/web/components/Properties.jsx
Christoffer Åström a57abf1ead refactor: internal packages structure (#94)
* refactor: internal packages structure

* refactor: internal packages structure
2019-08-27 09:57:04 +02:00

43 lines
733 B
JavaScript

import React from 'react';
import {
Typography,
} from '@nebula.js/ui/components';
import useProperties from '@nebula.js/nucleus/src/hooks/useProperties';
import Data from './property-panel/Data';
export default function Properties({
viz,
sn,
}) {
const [properties] = useProperties(viz ? viz.model : null);
if (!sn) {
return null;
}
if (!viz || !properties) {
return (
<div style={{
minWidth: '250px',
padding: '8px',
}}
>
<Typography>Nothing selected</Typography>
</div>
);
}
return (
<div style={{
minWidth: '250px',
padding: '8px',
}}
>
<Data properties={properties} model={viz.model} sn={sn} />
</div>
);
}