1import { type ReactNode } from "react";
2
3import { Sheet, SheetPopup } from "./ui/sheet";
4
5export function RightPanelSheet(props: {
6 animationDurationMs: number;
7 children: ReactNode;
8 open: boolean;
9 onClose: () => void;
10}) {
11 return (
12 <Sheet
13 open={props.open}
14 onOpenChange={(open) => {
15 if (!open) {
16 props.onClose();
17 }
18 }}
19 >
20 <SheetPopup
21 transitionDurationMs={props.animationDurationMs}
22 side="right"
23 showCloseButton={false}
24 keepMounted
25 className="w-[min(42vw,28rem)] min-w-80 max-w-[28rem] max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0 wco:mt-(--workspace-topbar-height) wco:h-[calc(100%-var(--workspace-topbar-height))] wco:max-h-[calc(100%-var(--workspace-topbar-height))]"
26 >
27 {props.children}
28 </SheetPopup>
29 </Sheet>
30 );
31}