26 lines
792 B
TypeScript
26 lines
792 B
TypeScript
// * Other
|
|
import SimpleString from "@/back/Components/Inputs/SimpleString";
|
|
import str from "@/hooks/use-string";
|
|
import useTrans from "@/hooks/use-translations";
|
|
|
|
type SimpleVimeoIdProps = {
|
|
className?: string;
|
|
name: string;
|
|
value?: string;
|
|
id?: string;
|
|
required?: boolean;
|
|
disabled?: boolean;
|
|
parentErrors?: Record<string, string> | null;
|
|
// eslint-disable-next-line no-unused-vars
|
|
setData: (name: string, value: string) => void;
|
|
};
|
|
|
|
export default function SimpleVimeoId(props: SimpleVimeoIdProps) {
|
|
const pattern = "^[0-9]{8,10}$";
|
|
const label = str(useTrans("uwil-backend::validation.custom.vimeo_id"))
|
|
.ucFirst()
|
|
.value();
|
|
|
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
return <SimpleString pattern={pattern} label={label} {...props} />;
|
|
}
|