/* eslint-disable react/jsx-props-no-spreading */ import * as React from 'react'; import { FaLightbulb, FaTractor } from 'react-icons/fa'; import { Menu, MenuItem, ProSidebar, SubMenu } from 'react-pro-sidebar'; import TuneRoundedIcon from '@mui/icons-material/TuneRounded'; import WidgetsRoundedIcon from '@mui/icons-material/WidgetsRounded'; import CameraAltRoundedIcon from '@mui/icons-material/CameraAltRounded'; import ReceiptLongRoundedIcon from '@mui/icons-material/ReceiptLongRounded'; import Box from '@mui/material/Box'; import { Leva } from 'leva'; import Tab from '@mui/material/Tab'; import Tabs from '@mui/material/Tabs'; import Typography from '@mui/material/Typography'; import { useEffect } from 'react'; import Divider from '@mui/material/Divider'; import StatusPanel from './StatusPanel'; import SceneNode from '../../SceneNode'; import LevaTheme from '../ConfigPanel/leva_theme.json'; import CameraPanel from './CameraPanel'; interface TabPanelProps { children: React.ReactNode; index: number; value: number; } function TabPanel(props: TabPanelProps) { const { children, value, index, ...other } = props; return ( ); } function a11yProps(index: number) { return { id: `simple-tab-${index}`, 'aria-controls': `simple-tabpanel-${index}`, }; } interface ListItemProps { name: object; object: object; } function ListItem(props: ListItemProps) { const name = props.name; const object = props.object; const [value, setValue] = React.useState(1); object.visible = value; function handleClick() { setValue(!value); } return ( ); } interface ClickableListProps { sceneTree: object; } function ClickableList(props: ClickableListProps) { const sceneTree = props.sceneTree; const get_menu_items = (name: String, scene_node: SceneNode) => { // TODO: sort the keys by string const num_children = Object.keys(scene_node.children).length; if (num_children === 0) { return ( }> ); } return ( } defaultOpen> {Object.keys(scene_node.children).map((key) => get_menu_items(key, scene_node.children[key]), )} ); }; const menu_items = get_menu_items('Scene', sceneTree); return ( {menu_items} ); } interface BasicTabsProps { sceneTree: object; } export function BasicTabs(props: BasicTabsProps) { const sceneTree = props.sceneTree; const [value, setValue] = React.useState(0); const handleChange = (event: React.SyntheticEvent, newValue: number) => { setValue(newValue); }; // set the panel pane index useEffect(() => { const panel_index = 0; setValue(panel_index); }, []); return (
} label="Controls" {...a11yProps(0)} /> } label="Scene" {...a11yProps(1)} /> } label="Render" {...a11yProps(2)} /> } label="Logs" {...a11yProps(3)} />
TODO: add a logging panel
); }