Refactor frontend pages and config components into single-component files for Task 13
This commit is contained in:
32
frontend/src/pages/blocklists/ImportResultDialog.tsx
Normal file
32
frontend/src/pages/blocklists/ImportResultDialog.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Button, Dialog, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, Text } from "@fluentui/react-components";
|
||||
import type { ImportRunResult } from "../../types/blocklist";
|
||||
|
||||
interface ImportResultDialogProps {
|
||||
open: boolean;
|
||||
result: ImportRunResult | null;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export function ImportResultDialog({ open, result, onClose }: ImportResultDialogProps): React.JSX.Element {
|
||||
if (!open || !result) return <></>;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(_ev, data) => { if (!data.open) onClose(); }}>
|
||||
<DialogSurface>
|
||||
<DialogBody>
|
||||
<DialogTitle>Import Complete</DialogTitle>
|
||||
<DialogContent>
|
||||
<Text size={200}>
|
||||
Total imported: {result.total_imported} | Skipped: {result.total_skipped} | Sources with errors: {result.errors_count}
|
||||
</Text>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button appearance="primary" onClick={onClose}>
|
||||
Close
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</DialogBody>
|
||||
</DialogSurface>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user