diff --git a/package-lock.json b/package-lock.json index d832ba9..bf33cda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@tanstack/react-query": "^5.83.0", - "attio": "0.0.1-experimental.20250829.2", + "attio": "0.0.1-experimental.20250915", "event-target-polyfill": "^0.0.4", "match-sorter": "8.0.3", "react": "19.0.0", @@ -1285,9 +1285,9 @@ "license": "MIT" }, "node_modules/attio": { - "version": "0.0.1-experimental.20250829.2", - "resolved": "https://registry.npmjs.org/attio/-/attio-0.0.1-experimental.20250829.2.tgz", - "integrity": "sha512-Glb7GSplL8RuPgCxZZptdseUqORoqO6dINsP1wJJ6iFqLqYbGSA+ArQxFEUMLKrx2DtPRCCHgEYwrYApcSXBCQ==", + "version": "0.0.1-experimental.20250915", + "resolved": "https://registry.npmjs.org/attio/-/attio-0.0.1-experimental.20250915.tgz", + "integrity": "sha512-4JsriW3ZAdoF6R9UPxC6dIVg2qlbnIBmeeuGoI8cPYJYHuEZQhTctH8ViivPAyvSQhxF6lExPOx+u299FAtC1Q==", "dependencies": { "@attio/fetchable-npm": "npm:@attio/fetchable@0.0.1-experimental.4", "@babel/code-frame": "^7.27.1", diff --git a/package.json b/package.json index 86e105f..f108b75 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@tanstack/react-query": "^5.83.0", - "attio": "0.0.1-experimental.20250829.2", + "attio": "0.0.1-experimental.20250915", "event-target-polyfill": "^0.0.4", "match-sorter": "8.0.3", "react": "19.0.0", diff --git a/src/components/comboboxes/companies-combobox.tsx b/src/components/comboboxes/companies-combobox.tsx index 9902c67..009225b 100644 --- a/src/components/comboboxes/companies-combobox.tsx +++ b/src/components/comboboxes/companies-combobox.tsx @@ -1,31 +1,21 @@ import type {FormApi} from "attio/client" import type {LogCustomerRequestFormSchema} from "../log-customer-request-dialog" -import {companiesProvider} from "./companies-options-provider" export function CompaniesCombobox({ Combobox, companyId, }: { - Combobox: FormApi["Combobox"] + Combobox: FormApi["Experimental_RecordCombobox"] companyId?: string }) { if (companyId) { - return ( - - ) + return } return ( diff --git a/src/components/comboboxes/companies-options-provider.ts b/src/components/comboboxes/companies-options-provider.ts deleted file mode 100644 index 2a9439d..0000000 --- a/src/components/comboboxes/companies-options-provider.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {type DecoratedComboboxOptionsProvider, runQuery} from "attio/client" -import GetCompanyByCompanyId from "../../graphql/get-company-by-id.graphql" -import SearchCompanies from "../../graphql/search-companies.graphql" - -export const companiesProvider: DecoratedComboboxOptionsProvider = { - async getOption(recordId) { - const result = await runQuery(GetCompanyByCompanyId, {companyId: recordId}) - return result?.company - ? result.company.logo_url - ? { - label: result.company.name || "Unnamed Company", - description: result.company.domains[0], - avatarUrl: result.company.logo_url, - } - : { - label: result.company.name || "Unnamed Company", - description: result.company.domains[0], - icon: "Company" as const, - } - : undefined - }, - - async search(query: string) { - const results = await runQuery(SearchCompanies, {query}) - - return results.experimental_searchCompanies.map((company) => ({ - label: company.name || company.domains[0] || "", - value: company.id, - description: company.domains[0], - ...(company.logo_url ? {avatarUrl: company.logo_url} : {icon: "Company"}), - })) - }, -} diff --git a/src/components/log-customer-request-dialog.tsx b/src/components/log-customer-request-dialog.tsx index 51850b1..7a2d3bc 100644 --- a/src/components/log-customer-request-dialog.tsx +++ b/src/components/log-customer-request-dialog.tsx @@ -33,15 +33,22 @@ export function LogCustomerRequestDialog({ attachmentUrl?: string onDone: () => void }) { - const {Form, TextInput, SubmitButton, Combobox, Experimental_RichTextInput, WithState} = - useForm(formSchema, { - companyRecordId, - description, - addTo: "", - title: "", - team: "", - attachmentUrl, - }) + const { + Form, + TextInput, + SubmitButton, + Combobox, + Experimental_RichTextInput, + WithState, + Experimental_RecordCombobox, + } = useForm(formSchema, { + companyRecordId, + description, + addTo: "", + title: "", + team: "", + attachmentUrl, + }) return (
{ @@ -89,7 +96,7 @@ export function LogCustomerRequestDialog({ } }} > - +