import { type ReadonlySignal, computed } from '@preact/signals'; import type { ReactNode } from 'preact/compat'; import { Store } from '~core/index'; import { signalWidgetViews } from '~web/state'; import { cn } from '~web/utils/helpers'; import { Header } from '~web/widget/header'; import { ViewInspector } from './inspector'; import { Toolbar } from './toolbar'; import { NotificationWrapper } from './notifications/notifications'; const isInspecting = computed( () => Store.inspectState.value.kind === 'inspecting', ); const headerClassName = computed(() => cn( 'relative', 'flex-1', 'flex flex-col', 'rounded-t-lg', 'overflow-hidden', 'opacity-100', 'transition-[opacity]', isInspecting.value && 'opacity-0 duration-0 delay-0', ), ); const isInspectorViewOpen = computed( () => signalWidgetViews.value.view === 'inspector', ); const isNotificationsViewOpen = computed( () => signalWidgetViews.value.view === 'notifications', ); export const Content = () => { return (
); }; interface ContentViewProps { isOpen: ReadonlySignal; children: ReactNode; } const ContentView = ({ isOpen, children }: ContentViewProps) => { return (
{children}
); };