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 (