'use client'; import { isAfter } from 'date-fns'; import { motion } from 'framer-motion'; import { useState } from 'react'; import { useSWRConfig } from 'swr'; import { useWindowSize } from 'usehooks-ts'; import { Document } from '@/db/schema'; import { getDocumentTimestampByIndex } from '@/lib/utils'; import { UICanvas } from './canvas'; import { LoaderIcon } from './icons'; import { Button } from '../ui/button'; interface VersionFooterProps { canvas: UICanvas; handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void; documents: Array | undefined; currentVersionIndex: number; } export const VersionFooter = ({ canvas, handleVersionChange, documents, currentVersionIndex, }: VersionFooterProps) => { const { width } = useWindowSize(); const isMobile = width < 768; const { mutate } = useSWRConfig(); const [isMutating, setIsMutating] = useState(false); if (!documents) return; return (
You are viewing a previous version
Restore this version to make edits
); };