import { DialogStack } from '@hanzo/ui'
Three panels offset diagonally, the last one in the list on top.
export function Default() {return (<YStack width="100%" minH={220} items="center" justify="center"><DialogStack width={320} height={160} dialogs={initial} /></YStack>)}
Each corner button removes its own panel from the stack, revealing the one behind it.
export function Closeable() {const [dialogs, setDialogs] = useState(initial)return (<YStack width="100%" minH={220} items="center" justify="center"><DialogStack width={320} height={160} dialogs={dialogs} onClose={(id) => setDialogs((rest) => rest.filter((d) => d.id !== id))} /></YStack>)}
The stack works with any number of dialogs, not only three.
export function TwoPanels() {return (<YStack width="100%" minH={200} items="center" justify="center"><DialogStack width={280} height={140} dialogs={[ { id: "a", title: "Draft", content: "Unsaved changes." }, { id: "b", title: "Review", content: "Ready to publish." }, ]} /></YStack>)}
export type DialogStackItem = {id: stringtitle: ReactNodecontent: ReactNode}
export type DialogStackProps = ComponentProps<typeof YStack> & {dialogs: DialogStackItem[]onClose?: (id: string) => void}