// * Other import SimpleString from "@/back/Components/Inputs/SimpleString"; import SimpleSwitch from "@/back/Components/Inputs/SimpleSwitch"; import useTrans from "@/hooks/use-translations"; import str from "@/hooks/use-string"; import { InputVideoValues } from "./VideoButton"; import { Separator } from "@/components/ui/separator"; import { ReactNode } from "react"; type VideoInputsProps = { value: InputVideoValues; onChange: (value: InputVideoValues) => void; errors?: Record; disabled?: boolean; loading?: boolean; }; export default function VideoInputs({ value, onChange, errors = {}, disabled = false, loading = false, }: VideoInputsProps) { const transVideoCaption = useTrans("back.input_video.caption"); return ( <> {/* Input alt attribute of the image. */} onChange({ ...value, alt: v })} disabled={disabled || loading} parentErrors={errors} /> {/* Input switch to set the caption visibility. */} onChange({ ...value, hasCaption: v, caption: v ? value.caption : null, }) } /> {/* Input caption of the video. */} {value.hasCaption && (
onChange({ ...value, caption: v })} disabled={disabled || loading} parentErrors={errors} />
)}
onChange({ ...value, isMuted: v, }) } parentErrors={errors} /> onChange({ ...value, hasControls: v, }) } parentErrors={errors} /> {value.hasControls && (
onChange({ ...value, canFullScreen: v, }) } parentErrors={errors} />
)}
); } const SimpleSwitchLayout = ({ children }: { children: ReactNode }) => { return (
{children}
) }