import { CRDTOperation, useLibraryQuery, useLibrarySubscription } from '@sd/client'; import { tw } from '@sd/ui'; const Label = tw.span`text-gray-300`; const Pill = tw.span`rounded-full bg-gray-500 px-2 py-1`; const Row = tw.p`overflow-hidden text-ellipsis space-x-1`; const OperationItem = ({ op }: { op: CRDTOperation }) => { let contents = null; if ('record_id' in op.typ) { let subContents = null; if (op.typ.data === null) { subContents = 'Delete'; } else if (op.typ.data === 'a' || 'u' in op.typ.data) { subContents = 'Create'; } else { subContents = `Update - ${op.typ.data.field}`; } contents = ( <>