Loading...
"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 { Card } from "@/components/ui/card"; 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...
Add PDF contracts and let the AI pipeline extract summary, key points, and legal-business insights.
Review contract lifecycle, trigger analysis, and ask AI questions per file.