import { useQuery } from '@tanstack/react-query'; import { History } from 'lucide-react'; import { Badge } from '#/components/atoms/badge.jsx'; import { Card } from '#/components/atoms/card.jsx'; import { Link } from '#/components/atoms/link.jsx'; import { Notice } from '#/components/atoms/notice.jsx'; import { Skeleton } from '#/components/atoms/skeleton.jsx'; import { EmptyState } from '#/components/molecules/empty-state.jsx'; import { RepoScope } from '#/components/molecules/repo-scope.jsx'; import { ago, rkeyTime } from '#/lib/format.js'; import { href } from '#/lib/navigation.jsx'; import { useSession } from '#/lib/session.jsx'; import { listRepoOps } from '#/lib/spaces.js'; /** * What one op did. The wire says it in two fields: a `cid` of null is a delete, * and a `prev` names the version this one replaced. * @param {{cid: string|null, prev: string|null}} op * @returns {string} */ function opAction(op) { if (!op.cid) return 'delete'; return op.prev ? 'update' : 'create'; } export function OpsPage({ space, repo }) { const { session } = useSession(); const { data, error, isPending } = useQuery({ queryKey: ['ops', space, repo], queryFn: () => listRepoOps(session, { space, repo }), retry: false, }); return (
Every write this repo made to the space, oldest first on the wire and newest first here. A syncer reads the same list to catch up from a revision it already holds.
{isPending &&