index.tsx
584 Bytes
import { Drawer, type DrawerProps } from 'antd';
export type UDrawerProps = DrawerProps;
/** Unified detail drawer; responsive width and lifecycle defaults remain overridable. */
export function UDrawer({ size = 760, destroyOnHidden = true, styles, ...props }: UDrawerProps) {
return (
<Drawer
size={size}
destroyOnHidden={destroyOnHidden}
styles={(info) => {
const custom = typeof styles === 'function' ? styles(info) : styles;
return { ...custom, wrapper: { maxWidth: '94vw', ...custom?.wrapper } };
}}
{...props}
/>
);
}