import type { FC, ReactNode } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import classNames from 'classnames'; import { Button } from '@/mastodon/components/button'; import { IconButton } from '@/mastodon/components/icon_button'; import { NavigationFocusTarget } from '@/mastodon/components/navigation_focus_target'; import CloseIcon from '@/material-icons/400-24px/close.svg?react'; export type { BaseConfirmationModalProps as DialogModalProps } from './confirmation_modals/confirmation_modal'; interface DialogModalProps { className?: string; title: ReactNode; onClose: () => void; description?: ReactNode; wrapperClassName?: string; children?: ReactNode; noCancelButton?: boolean; buttons?: ReactNode; } export const DialogModal: FC = ({ className, title, onClose, description, wrapperClassName, children, noCancelButton = false, buttons, }) => { const intl = useIntl(); return (
{title}
{description && (
{description}
)}
{children}
{(buttons || !noCancelButton) && (
{!noCancelButton && ( )} {buttons}
)}
); };