mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 20:17:42 +03:00
pass regex through TextEntryDialog
This commit is contained in:
parent
0af58caf1c
commit
f8ef5777b0
@ -20,6 +20,8 @@ type TextEntryDialogProps = {
|
|||||||
onSave: (text: string) => void;
|
onSave: (text: string) => void;
|
||||||
defaultValue?: string;
|
defaultValue?: string;
|
||||||
allowEmpty?: boolean;
|
allowEmpty?: boolean;
|
||||||
|
regexPattern?: RegExp;
|
||||||
|
regexErrorMessage?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function TextEntryDialog({
|
export default function TextEntryDialog({
|
||||||
@ -30,6 +32,8 @@ export default function TextEntryDialog({
|
|||||||
onSave,
|
onSave,
|
||||||
defaultValue = "",
|
defaultValue = "",
|
||||||
allowEmpty = false,
|
allowEmpty = false,
|
||||||
|
regexPattern,
|
||||||
|
regexErrorMessage,
|
||||||
}: TextEntryDialogProps) {
|
}: TextEntryDialogProps) {
|
||||||
const { t } = useTranslation("common");
|
const { t } = useTranslation("common");
|
||||||
|
|
||||||
@ -44,6 +48,8 @@ export default function TextEntryDialog({
|
|||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
allowEmpty={allowEmpty}
|
allowEmpty={allowEmpty}
|
||||||
onSave={onSave}
|
onSave={onSave}
|
||||||
|
regexPattern={regexPattern}
|
||||||
|
regexErrorMessage={regexErrorMessage}
|
||||||
>
|
>
|
||||||
<DialogFooter className={cn("pt-4", isMobile && "gap-2")}>
|
<DialogFooter className={cn("pt-4", isMobile && "gap-2")}>
|
||||||
<Button type="button" onClick={() => setOpen(false)}>
|
<Button type="button" onClick={() => setOpen(false)}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user