import { useStore } from '@nanostores/react'; import { AnimatePresence, motion, type Variants } from 'framer-motion'; import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; import { workbenchStore } from '../../lib/stores/workbench'; import { cubicEasingFn } from '../../utils/easings'; import { IconButton } from '../ui/IconButton'; import { EditorPanel } from './EditorPanel'; import { Preview } from './Preview'; interface WorkspaceProps { chatStarted?: boolean; } const workbenchVariants = { closed: { width: 0, transition: { duration: 0.2, ease: cubicEasingFn, }, }, open: { width: '100%', transition: { duration: 0.2, ease: cubicEasingFn, }, }, } satisfies Variants; export function Workbench({ chatStarted }: WorkspaceProps) { const showWorkbench = useStore(workbenchStore.showWorkbench); return ( chatStarted && ( {showWorkbench && (
{ workbenchStore.showWorkbench.set(false); }} />
)}
) ); }