import React from 'react'; import { RefreshCcw, RefreshCw, Users, Shield } from 'lucide-react'; import type { LoggedInUser } from '../../types'; interface SyncOverviewProps { stats: { totalUsers: number; subscriptions: number; superAdmins: number; payments: number; }; adminLogs: string[]; onClearLogs: () => void; } export const SyncOverview: React.FC = ({ stats, adminLogs, onClearLogs, }) => { return (
{/* 4 Summary Metric Cards */}

{stats.totalUsers}

Total Users

{stats.subscriptions}

Subscriptions

{stats.superAdmins}

Super Admins

{stats.payments}

Payments

{/* Terminal Log Console */}
System Event Logging Ledger
{adminLogs.length === 0 ? (

No admin actions performed in this session. Logs will print here...

) : ( adminLogs.map((log, index) => { const isError = log.includes('FAILED') || log.includes('Error'); const isSuccess = log.includes('SUCCESS'); return (

{log}

); }) )}
); }; export const SyncTopCards: React.FC<{ loggedInUser: LoggedInUser | null; adminSyncing: boolean; onForceSync: () => void; }> = ({ loggedInUser, adminSyncing, onForceSync }) => { return (
{/* Force Sync Box */}

Database Sync

Pulls active payment states from the Razorpay API and resolves pending database rows.

{/* Status Box */}

User Session

{loggedInUser ? (

✓ Email: {loggedInUser.email}

✓ Country: {loggedInUser.country || 'N/A'}

✓ Roles: {(loggedInUser.roles || []).join(', ')}

) : (

No session active. Register on storefront.

)}
{/* Compliance Box */}

Tax Compliance

✓ CGST: 9% split

✓ SGST: 9% split

✓ ISO compliance generated automatically

); };