ldc-ovoteam/resources/ts/back/Components/Inputs/SimpleVimeoId.tsx

24 lines
683 B
TypeScript
Raw Permalink Normal View History

2026-03-30 14:17:31 +02:00
import SimpleString from "@/back/Components/Inputs/SimpleString";
import str from "@/hooks/use-string";
import trans from "@/hooks/use-translations";
2026-03-30 14:17:31 +02:00
interface SimpleVimeoIdProps {
2026-03-30 14:17:31 +02:00
className?: string;
name: string;
value?: string;
id?: string;
required?: boolean;
disabled?: boolean;
parentErrors?: Record<string, string> | null;
setData: (name: string, value: string) => void;
}
2026-03-30 14:17:31 +02:00
export default function SimpleVimeoId(props: Readonly<SimpleVimeoIdProps>) {
2026-03-30 14:17:31 +02:00
const pattern = "^[0-9]{8,10}$";
const label = str(trans("uwil-backend::validation.custom.vimeo_id"))
2026-03-30 14:17:31 +02:00
.ucFirst()
.value();
return <SimpleString pattern={pattern} label={label} {...props} />;
}