// Shared chrome of the quick-action modals (header with icon/title/subtitle and // close, body slot, footer with cancel + one primary action). Extracted from the // project quick actions so any screen that offers the same kind of "one small // thing, right here" action gets the same dialog instead of a lookalike. // // Pure/presentational: it owns no draft state and performs no navigation — the // caller passes the body and decides what submitting means. import type { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { FeatherCheck, FeatherX } from "@subframe/core"; import { Button } from "~/ui/components/Button"; import { Dialog } from "~/ui/components/Dialog"; import { IconButton } from "~/ui/components/IconButton"; import { IconWithBackground } from "~/ui/components/IconWithBackground"; export type QuickActionDialogProps = { open: boolean; onOpenChange: (open: boolean) => void; icon: ReactNode; iconVariant: "warning" | "information" | "success" | "neutral"; title: string; subtitle: string; submitLabel: string; /** Defaults to the check the "erstellen" dialogs use. */ submitIcon?: ReactNode; submitting: boolean; submitDisabled?: boolean; onSubmit: () => void; uiId: string; children: ReactNode; }; export function QuickActionDialog(props: QuickActionDialogProps) { const { t } = useTranslation(); return ( {/* w-112 like every one of Davids four exports. */}
{props.title} {props.subtitle}
} onClick={() => props.onOpenChange(false)} data-ui-id={`${props.uiId}.close`} />
{props.children}
); } export default QuickActionDialog;