From abb6df7383cfdca39fd609445bc1b62e287c6066 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 11 May 2024 01:33:16 -0500 Subject: [PATCH] Add lock icon to non-autodetect target types --- src/components/form/LookupInput.tsx | 44 +++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/components/form/LookupInput.tsx b/src/components/form/LookupInput.tsx index 89f094f..16230ad 100644 --- a/src/components/form/LookupInput.tsx +++ b/src/components/form/LookupInput.tsx @@ -6,10 +6,17 @@ import type { SimplifiedTargetType, SubmitProps, TargetType } from "@/types"; import { CheckIcon, ChevronUpDownIcon, + LockClosedIcon, MagnifyingGlassIcon, ArrowPathIcon, } from "@heroicons/react/20/solid"; -import { Listbox, ListboxButton, ListboxOptions, ListboxOption, Transition } from "@headlessui/react"; +import { + Listbox, + ListboxButton, + ListboxOptions, + ListboxOption, + Transition, +} from "@headlessui/react"; import clsx from "clsx"; import type { Maybe } from "true-myth"; import { placeholders } from "@/constants"; @@ -174,7 +181,7 @@ const LookupInput: FunctionComponent = ({ disabled={isLoading} >
- = ({ > {/* Fetch special text for 'auto' mode, otherwise just use the options. */} - {selected == "auto" - ? // If the detected type was provided, then notate which in parentheses. Compact object naming might be better in the future. - detectedType.isJust - ? `Auto (${targetShortNames[detectedType.value]})` - : objectNames["auto"] - : objectNames[selected]} + {selected == "auto" ? ( + // If the detected type was provided, then notate which in parentheses. Compact object naming might be better in the future. + detectedType.isJust ? ( + `Auto (${targetShortNames[detectedType.value]})` + ) : ( + objectNames["auto"] + ) + ) : ( + <> + + {objectNames[selected]} + + )} = ({ ) : ( - )}