import type React from "react"; import { majorScale, Pane } from "evergreen-ui"; import { useAppStore } from "@app/core/stores/appStore.js"; import { DeviceWrapper } from "@app/DeviceWrapper.js"; import { useDeviceStore } from "@core/stores/deviceStore.js"; import { NoDevice } from "../misc/NoDevice.js"; import { Progress } from "../Progress.js"; import { Header } from "./Header.js"; import { Sidebar } from "./Sidebar/index.js"; export interface AppLayoutProps { children: React.ReactNode; } export const AppLayout = ({ children }: AppLayoutProps): JSX.Element => { const { getDevices } = useDeviceStore(); const { selectedDevice } = useAppStore(); const devices = getDevices(); return (
{devices.length ? ( devices.map((device, index) => ( {device && device.ready ? ( <> {children} ) : ( <> )} )) ) : ( )} ); };