chore: rename blocks to artifacts (#793)

This commit is contained in:
Jeremy 2025-02-13 08:25:57 -08:00 committed by GitHub
parent 01f589b603
commit 81f909ac3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 473 additions and 473 deletions

View file

@ -9,10 +9,9 @@ import { useWindowSize } from 'usehooks-ts';
import type { Document } from '@/lib/db/schema';
import { getDocumentTimestampByIndex } from '@/lib/utils';
import type { UIBlock } from './block';
import { LoaderIcon } from './icons';
import { Button } from './ui/button';
import { useBlock } from '@/hooks/use-block';
import { useArtifact } from '@/hooks/use-artifact';
interface VersionFooterProps {
handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void;
@ -25,7 +24,7 @@ export const VersionFooter = ({
documents,
currentVersionIndex,
}: VersionFooterProps) => {
const { block } = useBlock();
const { artifact } = useArtifact();
const { width } = useWindowSize();
const isMobile = width < 768;
@ -57,8 +56,8 @@ export const VersionFooter = ({
setIsMutating(true);
mutate(
`/api/document?id=${block.documentId}`,
await fetch(`/api/document?id=${block.documentId}`, {
`/api/document?id=${artifact.documentId}`,
await fetch(`/api/document?id=${artifact.documentId}`, {
method: 'PATCH',
body: JSON.stringify({
timestamp: getDocumentTimestampByIndex(