// import dependencies
import React, { useRef, useState } from 'react';
import { Box, Stack, View, TabContext, TabList, Button, TextField, Icon, Color, Modal, Tab, useTheme } from '../';
// colors
import colors from '../colors';
// create menu component
const DashupUIBlockConfig = (props = {}) => {
// theme
const theme = useTheme();
// tabs
const [tab, setTab] = useState('config');
const [color, setColor] = useState(false);
// refs
const colorRef = useRef(null);
// get struct
const struct = props.getBlockStruct(props.block.type);
// tabs
const tabs = struct?.data?.tabs || ['config'];
// return JSX
return !!props.block && !!struct ? (
<>
props.setBlock(props.block, 'name', e.target.value) }
fullWidth
/>
setTab(v.toLowerCase()) }>
{ tabs.map((t, i) => {
// return jsx
return ;
}) }
{ !!color && setColor(false) } onChange={ (hex) => props.setBlock(props.block, 'color', hex.hex === 'transparent' ? null : hex) } /> }
>
) : null;
};
// export default page menu
export default DashupUIBlockConfig;