Rename to blocks (#502)

This commit is contained in:
Jeremy 2024-11-07 02:40:29 +03:00 committed by GitHub
parent 22a09de6e6
commit 729634e1d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 108 additions and 111 deletions

View file

@ -9,19 +9,19 @@ import { useWindowSize } from 'usehooks-ts';
import { Document } from '@/db/schema';
import { getDocumentTimestampByIndex } from '@/lib/utils';
import { UICanvas } from './canvas';
import { UIBlock } from './block';
import { LoaderIcon } from './icons';
import { Button } from '../ui/button';
interface VersionFooterProps {
canvas: UICanvas;
block: UIBlock;
handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void;
documents: Array<Document> | undefined;
currentVersionIndex: number;
}
export const VersionFooter = ({
canvas,
block,
handleVersionChange,
documents,
currentVersionIndex,
@ -56,8 +56,8 @@ export const VersionFooter = ({
setIsMutating(true);
mutate(
`/api/document?id=${canvas.documentId}`,
await fetch(`/api/document?id=${canvas.documentId}`, {
`/api/document?id=${block.documentId}`,
await fetch(`/api/document?id=${block.documentId}`, {
method: 'PATCH',
body: JSON.stringify({
timestamp: getDocumentTimestampByIndex(