diff --git a/frontend/src/pages/views/MassEditor.tsx b/frontend/src/pages/views/MassEditor.tsx index 3e6fa1035..02668302d 100644 --- a/frontend/src/pages/views/MassEditor.tsx +++ b/frontend/src/pages/views/MassEditor.tsx @@ -1,10 +1,10 @@ import { useIsAnyMutationRunning, useLanguageProfiles } from "@/apis/hooks"; import { SimpleTable, Toolbox } from "@/components"; -import { Selector } from "@/components/inputs"; +import { Selector, SelectorOption } from "@/components/inputs"; import { useCustomSelection } from "@/components/tables/plugins"; import { GetItemId, useSelectorOptions } from "@/utilities"; import { faCheck, faUndo } from "@fortawesome/free-solid-svg-icons"; -import { Container } from "@mantine/core"; +import { Box, Container } from "@mantine/core"; import { uniqBy } from "lodash"; import { useCallback, useMemo, useState } from "react"; import { UseMutationResult } from "react-query"; @@ -36,6 +36,24 @@ function MassEditor(props: MassEditorProps) { const profileOptions = useSelectorOptions(profiles ?? [], (v) => v.name); + const profileOptionsWithAction = useMemo< + SelectorOption[] + >( + () => [ + { label: "Clear", value: null, group: "Action" }, + ...profileOptions.options, + ], + [profileOptions.options] + ); + + const getKey = useCallback((value: Language.Profile | null) => { + if (value) { + return value.name; + } + + return "Clear"; + }, []); + const { mutateAsync } = mutation; const save = useCallback(() => { @@ -67,15 +85,17 @@ function MassEditor(props: MassEditorProps) { return ( -
+ -
-
+ + Cancel @@ -87,7 +107,7 @@ function MassEditor(props: MassEditorProps) { > Save -
+