From 4155e3498b184e4f5deca5ed9ce97085d19926f2 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 21 Nov 2024 14:21:27 -0500 Subject: [PATCH] feat(beacon): add assembly-wise chromosome selector TODO: translation, testing, network --- .../Beacon/BeaconCommon/VariantInput.tsx | 20 ++++- .../Beacon/BeaconCommon/VariantsForm.tsx | 90 ++++++++++++++++--- src/js/features/reference/hooks.ts | 5 ++ 3 files changed, 99 insertions(+), 16 deletions(-) diff --git a/src/js/components/Beacon/BeaconCommon/VariantInput.tsx b/src/js/components/Beacon/BeaconCommon/VariantInput.tsx index 397774d9..5d727dd8 100644 --- a/src/js/components/Beacon/BeaconCommon/VariantInput.tsx +++ b/src/js/components/Beacon/BeaconCommon/VariantInput.tsx @@ -1,13 +1,26 @@ -import { Form, Input } from 'antd'; +import { Form, Input, Select } from 'antd'; +import type { DefaultOptionType } from 'antd/es/select/index'; import { useTranslationFn } from '@/hooks'; import type { FormField } from '@/types/beacon'; -const VariantInput = ({ field, disabled }: VariantInputProps) => { +type InputMode = { type: 'input' } | { type: 'select'; options?: DefaultOptionType[] }; + +const VariantInput = ({ field, disabled, mode }: VariantInputProps) => { const t = useTranslationFn(); return ( <> - + {!mode || mode.type === 'input' ? ( + + ) : ( +