import React, { useEffect, useRef } from 'react'; import { PiAppleLogo, PiWindowsLogo } from 'react-icons/pi'; import type { Meta } from '@storybook/react-vite'; import { useStore } from 'zustand'; import { ComponentProvider } from '../components'; import { useRootWindow, useWindow } from './ReactWindow'; import { WindowFrame } from './WindowFrame'; import { WindowHost } from './WindowHost'; import { getWindowStyleStore } from './WindowStyleStore'; import { WindowTest } from './WindowTest'; const meta: Meta = { title: 'window', parameters: { layout: 'fullscreen', }, }; export default meta; export const Windows = () => { let store = getWindowStyleStore(); let theme = useStore(store, (s) => s.theme) ?? 'system'; let ref = useRef(null); useEffect(() => { if (!ref.current) { return; } if (theme === 'system') { ref.current.indeterminate = true; } else { ref.current.checked = theme !== 'macos'; } }, [ref.current, theme]); return (
Hello
); }; export const Demo = () => { let win = useRootWindow(); return (
); };