ldc-ovoteam/resources/ts/back/Components/Inputs/SimpleYoutubeId.tsx
Jérémy Munsch cd2d8ed397
refactor(i18n): replace GetTranslation with trans function
- Updated translation utility to improve consistency and reduce redundancy.
- Removed deprecated useTrans hook and related code.
- Introduced a new Zustand store for managing translations and locale settings.
- Cleaned up unused hooks and files related to localization.
2026-10-19 17:43:33 +02:00

23 lines
717 B
TypeScript

import SimpleString from "@/back/Components/Inputs/SimpleString";
import str from "@/hooks/use-string";
import trans from "@/hooks/use-translations";
interface SimpleYoutubeIdProps {
className?: string;
name: string;
value?: string;
id?: string;
required?: boolean;
disabled?: boolean;
parentErrors?: Record<string, string> | null;
setData: (name: string, value: string) => void;
}
export default function SimpleYoutubeId(props: Readonly<SimpleYoutubeIdProps>) {
const pattern = "^[0-9A-Za-z_\\-]{10}[048AEIMQUYcgkosw]$";
const label = str(trans("uwil-backend::validation.custom.youtube_id"))
.ucFirst()
.value();
return <SimpleString pattern={pattern} label={label} {...props} />;
}