import { useEffect, useMemo, useState } from "react"; import { api } from "../lib/api"; import { useDebouncedValue } from "./ListControls"; import { Input, Select } from "./Ui"; type Option = { id: string; title: string; projectNumber?: string }; type Page = { items: Option[]; totalCount: number }; export function RelatedEntitySelect({ name, path, value, onChange, placeholder, required = true }: { name: string; path: "/api/v1/ideas" | "/api/v1/projects"; value: string; onChange: (id: string) => void; placeholder: string; required?: boolean; }) { const [search, setSearch] = useState(""); const query = useDebouncedValue(search); const [items, setItems] = useState([]); const [selected, setSelected] = useState