'use client'; import { Variants, motion } from 'framer-motion'; import { Plus } from 'lucide-react'; import { useDropzone } from 'react-dropzone'; import { cn } from '@documenso/ui/lib/utils'; import { Card, CardContent } from '@documenso/ui/primitives/card'; const DocumentDropzoneContainerVariants: Variants = { initial: { scale: 1, }, animate: { scale: 1, }, hover: { transition: { staggerChildren: 0.05, }, }, }; const DocumentDropzoneCardLeftVariants: Variants = { initial: { x: 40, y: -10, rotate: -14, }, animate: { x: 40, y: -10, rotate: -14, }, hover: { x: -25, y: -25, rotate: -22, }, }; const DocumentDropzoneCardRightVariants: Variants = { initial: { x: -40, y: -10, rotate: 14, }, animate: { x: -40, y: -10, rotate: 14, }, hover: { x: 25, y: -25, rotate: 22, }, }; const DocumentDropzoneCardCenterVariants: Variants = { initial: { x: 0, y: 0, }, animate: { x: 0, y: 0, }, hover: { x: 0, y: -25, }, }; export type DocumentDropzoneProps = { className?: string; disabled?: boolean; onDrop?: (_file: File) => void | Promise; [key: string]: unknown; }; export const DocumentDropzone = ({ className, onDrop, disabled, ...props }: DocumentDropzoneProps) => { const { getRootProps, getInputProps } = useDropzone({ accept: { 'application/pdf': ['.pdf'], }, multiple: false, disabled, onDrop: ([acceptedFile]) => { if (acceptedFile && onDrop) { void onDrop(acceptedFile); } }, }); return ( {/* */}

Add a document

Drag & drop your document here.

); };