diff --git a/frontend/src/components/forms/ProfileEditForm.tsx b/frontend/src/components/forms/ProfileEditForm.tsx index 50074cbc7..a4f394942 100644 --- a/frontend/src/components/forms/ProfileEditForm.tsx +++ b/frontend/src/components/forms/ProfileEditForm.tsx @@ -9,6 +9,7 @@ import { Accordion, Button, Checkbox, + Select, Stack, Switch, Text, @@ -34,6 +35,21 @@ const defaultCutoffOptions: SelectorOption[] = [ }, ]; +const subtitlesTypeOptions: SelectorOption[] = [ + { + label: "Normal or hearing-impaired", + value: "normal", + }, + { + label: "Hearing-impaired required", + value: "hi", + }, + { + label: "Forced (foreign part only)", + value: "forced", + }, +]; + interface Props { onComplete?: (profile: Language.Profile) => void; languages: readonly Language.Info[]; @@ -157,43 +173,38 @@ const ProfileEditForm: FunctionComponent = ({ }, }, { - Header: "Forced", + Header: "Subtitles Type", accessor: "forced", Cell: ({ row: { original: item, index }, value }) => { + const selectValue = useMemo(() => { + if (item.forced === "True") { + return "forced"; + } else if (item.hi === "True") { + return "hi"; + } else { + return "normal"; + } + }, [item.forced, item.hi]); + return ( - { - action.mutate(index, { - ...item, - forced: checked ? "True" : "False", - hi: checked ? "False" : item.hi, - }); - }} - > - ); - }, - }, - { - Header: "HI", - accessor: "hi", - Cell: ({ row: { original: item, index }, value }) => { - return ( - { - action.mutate(index, { - ...item, - hi: checked ? "True" : "False", - forced: checked ? "False" : item.forced, - }); + ); }, }, { - Header: "Exclude Audio", + Header: "Exclude If Matching Audio", accessor: "audio_exclude", Cell: ({ row: { original: item, index }, value }) => { return ( @@ -317,8 +328,6 @@ export const ProfileEditModal = withModal( "languages-profile-editor", { title: "Edit Languages Profile", - size: "lg", + size: "xl", } ); - -export default ProfileEditForm;