Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

RightPanelSheet.tsx

32 lines719 Bytes

1import { type ReactNode } from "react";
2​
3import { RIGHT_PANEL_SHEET_CLASS_NAME } from "../rightPanelLayout";
4import { Sheet, SheetPopup } from "./ui/sheet";
5​
6export function RightPanelSheet(props: {
7 animationDurationMs: number;
8 children: ReactNode;
9 open: boolean;
10 onClose: () => void;
11}) {
12 return (
13 <Sheet
14 open={props.open}
15 onOpenChange={(open) => {
16 if (!open) {
17 props.onClose();
18 }
19 }}
20 >
21 <SheetPopup
22 transitionDurationMs={props.animationDurationMs}
23 side="right"
24 showCloseButton={false}
25 keepMounted
26 className={RIGHT_PANEL_SHEET_CLASS_NAME}
27 >
28 {props.children}
29 </SheetPopup>
30 </Sheet>
31 );