This commit is contained in:
morpheus65535 2024-06-10 08:01:34 -04:00
parent ee90d3f40f
commit 225a3b65d4
1 changed files with 8 additions and 9 deletions

View File

@ -12,6 +12,7 @@ import {
} from "@mantine/core"; } from "@mantine/core";
import { useForm } from "@mantine/form"; import { useForm } from "@mantine/form";
import { faTrash } from "@fortawesome/free-solid-svg-icons"; import { faTrash } from "@fortawesome/free-solid-svg-icons";
import { cond } from "lodash";
import { Action, Selector, SelectorOption, SimpleTable } from "@/components"; import { Action, Selector, SelectorOption, SimpleTable } from "@/components";
import ChipInput from "@/components/inputs/ChipInput"; import ChipInput from "@/components/inputs/ChipInput";
import { useModals, withModal } from "@/modules/modals"; import { useModals, withModal } from "@/modules/modals";
@ -87,16 +88,14 @@ const ProfileEditForm: FunctionComponent<Props> = ({
const itemCutoffOptions = useSelectorOptions( const itemCutoffOptions = useSelectorOptions(
form.values.items, form.values.items,
(v) => { (v) => {
const suffix = const suffix = cond([
v.hi === "only" [(v: { forced: string; hi: string }) => v.hi === "only", () => ":hi"],
? ":hi" [(v) => v.hi === "never", () => ":normal"],
: v.hi === "never" [(v) => v.forced === "True", () => ":forced"],
? ":normal" [() => true, () => ""],
: v.forced === "True" ]);
? ":forced"
: "";
return v.language + suffix; return v.language + suffix(v);
}, },
(v) => String(v.id), (v) => String(v.id),
); );