From 94664892e43322b0a2d6f5b7f8fb27941291ae36 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Thu, 28 Sep 2023 10:28:43 +0100 Subject: [PATCH] It works! --- src/TA.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/TA.tsx b/src/TA.tsx index 973e7a1..a9a939e 100644 --- a/src/TA.tsx +++ b/src/TA.tsx @@ -1,4 +1,4 @@ -import {ReactNode} from "react"; +import {ReactNode, useCallback} from "react"; import AsyncSelect from "react-select/async"; import {FixedSizeList as List} from "react-window"; import Select, {createFilter, MenuListProps} from "react-select"; @@ -69,6 +69,11 @@ const TestSelect = (vendorOptions: any) => { ) } +interface Option { + value: string, + label: string, +} + export function LargeSelect() { const { data: options, @@ -83,13 +88,18 @@ export function LargeSelect() { return fullData.map(md => ({ value: md.relativePath as string, label: md.fileName as string - })); + }) as Option); }, }); + const onChange = useCallback((value: Option) => { + navigator.clipboard.writeText(`[[${value.label}]]`) + }, []); + return (