import { Drawer, Button, Space, Tabs } from "antd"; import { CloseOutlined } from "@ant-design/icons"; import type { ReactNode } from "react"; import "./DetailDrawer.css"; type DrawerTitle = { text: string; badge?: ReactNode; icon?: ReactNode; }; type HeaderAction = { key: string; label: string; type?: "default" | "primary" | "dashed" | "link" | "text"; icon?: ReactNode; danger?: boolean; disabled?: boolean; onClick: () => void; }; type DrawerTab = { key: string; label: ReactNode; content: ReactNode; }; interface DetailDrawerProps { visible: boolean; onClose: () => void; title?: DrawerTitle; headerActions?: HeaderAction[]; width?: number; children?: ReactNode; tabs?: DrawerTab[]; } function DetailDrawer({ visible, onClose, title, headerActions = [], width = 1080, children, tabs, }: DetailDrawerProps) { return (
{headerActions.map((action) => ( ))}
{children} {tabs && tabs.length > 0 && (
({ key: tab.key, label: tab.label, children:
{tab.content}
, }))} />
)}
); } export default DetailDrawer;