feat: unify detail side sheets
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import {
|
||||
WorkspaceSideSheet,
|
||||
type WorkspaceSideSheetBadgeColor
|
||||
} from './WorkspaceSideSheet';
|
||||
|
||||
type WorkspaceDetailSideSheetProps = {
|
||||
className?: string;
|
||||
visible: boolean;
|
||||
ariaLabel: string;
|
||||
closeLabel?: string;
|
||||
title: ReactNode;
|
||||
description: ReactNode;
|
||||
badge?: ReactNode;
|
||||
badgeColor?: WorkspaceSideSheetBadgeColor;
|
||||
placement?: 'left' | 'right' | 'top' | 'bottom';
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
onCancel: () => void;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export function WorkspaceDetailSideSheet({
|
||||
className,
|
||||
visible,
|
||||
ariaLabel,
|
||||
closeLabel,
|
||||
title,
|
||||
description,
|
||||
badge,
|
||||
badgeColor,
|
||||
placement,
|
||||
width,
|
||||
height,
|
||||
onCancel,
|
||||
children
|
||||
}: WorkspaceDetailSideSheetProps) {
|
||||
return <WorkspaceSideSheet
|
||||
className={className}
|
||||
variant="detail"
|
||||
visible={visible}
|
||||
ariaLabel={ariaLabel}
|
||||
closeLabel={closeLabel}
|
||||
title={title}
|
||||
description={description}
|
||||
badge={badge}
|
||||
badgeColor={badgeColor}
|
||||
placement={placement}
|
||||
width={width}
|
||||
height={height}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
{children}
|
||||
</WorkspaceSideSheet>;
|
||||
}
|
||||
Reference in New Issue
Block a user