import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useAuth } from '../../context/AuthContext'; import FinancialKPICards from '../../components/owner/FinancialKPICards'; import UrgentItemsPanel from '../../components/owner/UrgentItemsPanel'; import FinancialDetailsModal from '../../components/owner/FinancialDetailsModal'; import ActionCenterModal from '../../components/owner/ActionCenterModal'; import { SpotlightCard } from '../../components/SpotlightCard'; const OwnerSnapshot = () => { const { user } = useAuth(); const navigate = useNavigate(); // Modal States const [financialModal, setFinancialModal] = useState({ isOpen: false, type: 'revenue' }); const [actionModal, setActionModal] = useState({ isOpen: false, filter: 'all' }); // Handlers const handleFinancialClick = (type) => { setFinancialModal({ isOpen: true, type }); }; const handleActionClick = (id) => { // Map IDs to filter types const filterMap = { 'docs': 'docs', 'vendors': 'vendors', 'invoices': 'invoices', 'all': 'all' }; setActionModal({ isOpen: true, filter: filterMap[id] || 'all' }); }; // Get time of day for greeting const hour = new Date().getHours(); const greeting = hour < 12 ? 'Good Morning' : hour < 18 ? 'Good Afternoon' : 'Good Evening'; return (
{/* Ambient Background Glows */}
{/* Header Section */}

{greeting}, {user?.name?.split(' ')[0] || 'Owner'}

Here's your business snapshot for today.

{/* Financial KPIs */}

Financial Overview

{/* Main Content Grid */}
{/* Urgent Items Panel (Takes up 2 columns on large screens) */}
{/* Activity Feed / Notifications Placeholder (Right Column) */}

Recent Activity

{[1, 2, 3].map((i) => (

New invoice submitted by Texas Builders LLC

2 hours ago
))}

Payment received for Project P-2602

5 hours ago
{/* Interactive Modals */} setFinancialModal({ ...financialModal, isOpen: false })} type={financialModal.type} /> setActionModal({ ...actionModal, isOpen: false })} defaultFilter={actionModal.filter} // Force re-render on filter change if needed, generally okay as props update key={actionModal.filter} />
); }; export default OwnerSnapshot;