Loading workspace
Preparing your contract environment...
"use client"; import { ContractUploadForm } from "@/features/contracts/components/forms/contract-upload-form"; import { EmptyContractsState } from "@/features/contracts/components/list/empty-contracts-state"; import { ContractsList } from "@/features/contracts/components/list/contracts-list"; import { ContractsHeader } from "@/components/layout/contacts-header"; import { useState, useEffect } from "react"; import { getContracts } from "@/features/contracts/api/contract.action"; import { motion, AnimatePresence } from "motion/react"; import { Upload, FileText, Sparkles, Shield, Zap, ChevronRight, Loader2, } from "lucide-react"; export default function ContactsPage() { const [refreshTrigger, setRefreshTrigger] = useState(0); const [showContracts, setShowContracts] = useState(false); const [isChecking, setIsChecking] = useState(true); // Check if there are any existing contracts on mount useEffect(() => { const checkContracts = async () => { try { const result = await getContracts(); if ( result.success && Array.isArray(result.contracts) && result.contracts.length > 0 ) { setShowContracts(true); } } catch (error) { console.error("Failed to check contracts:", error); } finally { setIsChecking(false); } }; checkContracts(); }, []); const handleUploadSuccess = () => { setRefreshTrigger((prev) => prev + 1); setShowContracts(true); }; if (isChecking) { return (
Loading workspace
Preparing your contract environment...
PDF documents supported
Our AI pipeline will automatically extract summaries, key clauses, risk factors, and generate actionable business insights.
Manage, analyze, and query your document library
{feature.desc}