import Box from "@mui/material/Box"; import Stack from "@mui/material/Stack"; import TextField from "@mui/material/TextField"; import MenuItem from "@mui/material/MenuItem"; import Grid from "@mui/material/Grid"; import { useI18n } from "../../hooks/I18n"; import { OPT_LANGS_TO } from "../../config"; import FormControlLabel from "@mui/material/FormControlLabel"; import Alert from "@mui/material/Alert"; import Switch from "@mui/material/Switch"; import { useSubtitle } from "../../hooks/Subtitle"; import { useApiList } from "../../hooks/Api"; export default function SubtitleSetting() { const i18n = useI18n(); const { subtitleSetting, updateSubtitle } = useSubtitle(); const { enabledApis, aiEnabledApis } = useApiList(); const handleChange = (e) => { e.preventDefault(); let { name, value } = e.target; updateSubtitle({ [name]: value, }); }; const { enabled, apiSlug, segSlug, toLang, isBilingual, windowStyle, originStyle, translationStyle, } = subtitleSetting; return ( {i18n("subtitle_helper_1")}
{i18n("subtitle_helper_2")}
{ updateSubtitle({ enabled: !enabled }); }} /> } label={i18n("toggle_subtitle_translate")} /> {enabledApis.map((api) => ( {api.apiName} ))} {i18n("disable")} {aiEnabledApis.map((api) => ( {api.apiName} ))} {OPT_LANGS_TO.map(([lang, name]) => ( {name} ))} {i18n("enable")} {i18n("disable")}
); }