'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 type { Document } from '@/lib/db/schema'; import { getDocumentTimestampByIndex } from '@/lib/utils'; import { LoaderIcon } from './icons'; import { Button } from './ui/button'; import { useArtifact } from '@/hooks/use-artifact'; interface VersionFooterProps { handleVersionChange: (type: 'next' | 'prev' | 'toggle' | 'latest') => void; documents: Array | undefined; currentVersionIndex: number; } export const VersionFooter = ({ handleVersionChange, documents, currentVersionIndex, }: VersionFooterProps) => { const { artifact } = useArtifact(); 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
); };