mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-10-13 11:16:29 +02:00
* Fix login page * Increase face image size and add time ago * Add component for indicating steps in a wizard * Split out form inputs from dialog * Add wizard for adding new face to library * Simplify dialog * Translations * Fix scaling bug * Fix key missing * Improve multi select * Adjust wording and spacing * Add tip for face training * Fix padding * Remove text for buttons on mobile
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
import TextEntry from "@/components/input/TextEntry";
|
|
import { Button } from "@/components/ui/button";
|
|
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from "@/components/ui/dialog";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
type TextEntryDialogProps = {
|
|
open: boolean;
|
|
title: string;
|
|
description?: string;
|
|
setOpen: (open: boolean) => void;
|
|
onSave: (text: string) => void;
|
|
defaultValue?: string;
|
|
allowEmpty?: boolean;
|
|
};
|
|
|
|
export default function TextEntryDialog({
|
|
open,
|
|
title,
|
|
description,
|
|
setOpen,
|
|
onSave,
|
|
defaultValue = "",
|
|
allowEmpty = false,
|
|
}: TextEntryDialogProps) {
|
|
const { t } = useTranslation("common");
|
|
|
|
return (
|
|
<Dialog open={open} defaultOpen={false} onOpenChange={setOpen}>
|
|
<DialogContent>
|
|
<DialogHeader>
|
|
<DialogTitle>{title}</DialogTitle>
|
|
{description && <DialogDescription>{description}</DialogDescription>}
|
|
</DialogHeader>
|
|
<TextEntry
|
|
defaultValue={defaultValue}
|
|
allowEmpty={allowEmpty}
|
|
onSave={onSave}
|
|
>
|
|
<DialogFooter className="pt-4">
|
|
<Button type="button" onClick={() => setOpen(false)}>
|
|
{t("button.cancel")}
|
|
</Button>
|
|
<Button variant="select" type="submit">
|
|
{t("button.save")}
|
|
</Button>
|
|
</DialogFooter>
|
|
</TextEntry>
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|