import { Combobox } from "@tailor-platform/app-shell"; import { useCallback } from "react"; import { useClient } from "urql"; import { graphql } from "@/graphql"; import { cn } from "@/lib/utils"; const SupplierAccountSearchQuery = graphql(` query SupplierAccountSearch($query: SupplierAccountQueryInput, $first: Int) { supplierAccounts(query: $query, first: $first, order: [{ field: code, direction: Asc }]) { edges { node { id name companyId status defaultExpenseAccountId } } } } `); /** id is a SupplierAccount ID. */ export interface SupplierAccountRef { id: string; name: string; defaultExpenseAccountId?: string | null; } const DEBOUNCE_MS = 300; /** * Browse mode (empty input) must show the whole supplier list, mirroring the * plain