Add missing frontend and backend files
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Box, Button, DialogActions } from "@mui/material";
|
||||
|
||||
interface DialogFooterProps {
|
||||
onCancel: () => void;
|
||||
cancelLabel?: string;
|
||||
onConfirm: () => void;
|
||||
confirmLabel: string;
|
||||
confirmBusyLabel?: string;
|
||||
confirmDisabled?: boolean;
|
||||
confirmColor?: "primary" | "error" | "warning" | "success" | "inherit";
|
||||
confirmVariant?: "contained" | "outlined" | "text";
|
||||
confirmStartIcon?: ReactNode;
|
||||
secondaryAction?: ReactNode;
|
||||
}
|
||||
|
||||
export function DialogFooter({
|
||||
onCancel,
|
||||
cancelLabel = "Cancel",
|
||||
onConfirm,
|
||||
confirmLabel,
|
||||
confirmBusyLabel,
|
||||
confirmDisabled,
|
||||
confirmColor = "primary",
|
||||
confirmVariant = "contained",
|
||||
confirmStartIcon,
|
||||
secondaryAction,
|
||||
}: DialogFooterProps) {
|
||||
return (
|
||||
<DialogActions sx={{ px: 3, py: 2 }}>
|
||||
<Button onClick={onCancel}>{cancelLabel}</Button>
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
||||
{secondaryAction}
|
||||
<Button
|
||||
variant={confirmVariant}
|
||||
color={confirmColor}
|
||||
disabled={confirmDisabled}
|
||||
startIcon={confirmStartIcon}
|
||||
onClick={onConfirm}
|
||||
>
|
||||
{confirmBusyLabel ?? confirmLabel}
|
||||
</Button>
|
||||
</Box>
|
||||
</DialogActions>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user