import type { components } from "../api/schema"; import { useUpdateTerm, useDeleteTerm } from "../api/queries"; import { LabelledRecordRow } from "../components/labelled-record-row"; type TermView = components["schemas"]["TermView"]; export function TermRow({ vocabularyId, term, lang }: { vocabularyId: string; term: TermView; lang: string }) { const update = useUpdateTerm(); const del = useDeleteTerm(); return ( update.reset()} onSave={(labels, uri, done) => update.mutate({ vocabularyId, termId: term.id, external_uri: uri, labels }, { onSuccess: done })} onDelete={() => del.mutateAsync({ vocabularyId, termId: term.id })} /> ); }