/* eslint-disable react/jsx-props-no-spreading */ import React, { Ref, ReactNode } from 'react'; import ModalUnstyled from '@mui/base/ModalUnstyled'; import Button from '@webapp/ui/Button'; import cx from 'classnames'; import styles from './Dialog.module.css'; const Backdrop = React.forwardRef< HTMLDivElement, { open?: boolean; className: string } >((props, ref) => { const { open, className, ...other } = props; return
; }); type DialogHeaderProps = { children: ReactNode; className?: string } & ( | { closeable: true; onClose: () => void } | { closeable?: false } ); export const DialogHeader = React.forwardRef( (props: DialogHeaderProps, ref?: Ref) => { const { children, className, closeable } = props; return (
{children} {closeable ? (
); } ); interface DialogFooterProps { children: ReactNode; className?: string; } export const DialogFooter = React.forwardRef( (props: DialogFooterProps, ref?: Ref) => { const { children, className } = props; return (
{children}
); } ); interface DialogBodyProps { children: ReactNode; className?: string; } export const DialogBody = React.forwardRef( (props: DialogBodyProps, ref?: Ref) => { const { children, className } = props; return (
{children}
); } ); type DialogProps = Exclude< React.ComponentProps, 'components' > & { className?: string; /** The header ID */ ['aria-labelledby']: string; }; export function Dialog(props: DialogProps) { const { className } = props; return (
{props.children}
); } export function DialogActions({ children }: { children: React.ReactNode }) { return
{children}
; }