import type { components } from "../api/schema"; import { useUpdateAuthority, useDeleteAuthority } from "../api/queries"; import { LabelledRecordRow } from "../components/labelled-record-row"; type AuthorityView = components["schemas"]["AuthorityView"]; export function AuthorityRow({ authority, kind, lang }: { authority: AuthorityView; kind: string; lang: string }) { const update = useUpdateAuthority(); const del = useDeleteAuthority(); return ( update.reset()} onSave={(labels, uri, done) => update.mutate({ id: authority.id, kind, external_uri: uri, labels }, { onSuccess: done })} onDelete={() => del.mutateAsync({ id: authority.id, kind })} /> ); }