feat: major platform upgrade — AI extraction pipeline, responsive UI, admin chatbot enhancements
CRITICAL FIXES - Fix blank pages: useCallback declared after useEffect in all 5 pages - Fix showToast undefined everywhere (ToastContext exported addToast not showToast) - Fix admin doc upload always 422 (missing doc_key + doc_label form fields) - Fix audit log wrong field names (log.details -> log.detail, remove user_agent) - Fix SPA catch-all missing in main.py (direct URL access was 404) - Fix chatbot using broken nvidia free model -> llama-3.3-70b AI EXTRACTION PIPELINE - 3-stage pipeline: Stage1 native text (free) -> Stage2 Tesseract OCR (free CPU) -> Stage3 Qwen vision (paid) - Tesseract installed with eng+hin bilingual support, psm6, 2.5x DPI - Scanned PDF fallback via PyMuPDF page render - Blank template fallback: returns form_type/purpose/tax_year instead of empty - Improved prompt: extracts actual document field names, no predefined terms - Auto-poll UI: shows Processing spinner when extraction is running - backfill_extraction.py: re-process all docs, fixed empty-dict-as-None bug ADMIN DASHBOARD - Pending docs split into Pending Personal + Pending Business stat cards - User cards show typed badges: N personal / N business instead of generic N pending - Backend returns pending_personal, pending_business, pending_docs per user ADMIN USER DETAIL - Doc count chips in user info bar: personal / business / returns / total - Doc name bold 15px, date with calendar icon + TY chip, status as colored badges - Responsive layout: doc-review-layout CSS classes replace inline flex styles - Filing Timeline sidebar stacks above doc list on mobile - AI Summary: bold labels and values, blank template shows metadata CHATBOT ENHANCEMENTS - Ask anything free-text input on menu screen (both admin and user chatbots) - Admin: live context with latest uploads by date, new users today - Admin: per-user activity lookup by name/email (docs + audit log) - New endpoint: /api/chatbot/admin-user-context - ExpandableSummaryBlock + ExpandableValue: bold navy field labels and values RESPONSIVENESS - components.css: 480px/640px/768px breakpoints for all pages - Admin table, stat cards, tabs, toasts, FAB all properly responsive - Auth shell stacks on mobile correctly
This commit is contained in:
@@ -1,29 +1,19 @@
|
||||
export default function AboutUs() {
|
||||
return (
|
||||
<>
|
||||
{/* HERO */}
|
||||
<div className="page-hero" style={{
|
||||
backgroundImage: 'linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url("/images/About-us-background-image.webp")',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
minHeight: '400px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
textAlign: 'center',
|
||||
color: '#fff'
|
||||
}}>
|
||||
<div>
|
||||
<h1>About Us</h1>
|
||||
<p>Our People Are Passionate About What We Do</p>
|
||||
<div className="page-hero" style={{ '--hero-img': 'url("/images/About-us-background-image.webp")' }}>
|
||||
<div className="page-hero-inner">
|
||||
<span className="eyebrow">About BookKeepPro</span>
|
||||
<h1>Our people are passionate about what we do</h1>
|
||||
<p>Twenty-seven years of accounting, compliance and long-term client relationships.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* CONTENT */}
|
||||
<div className="about-wrapper">
|
||||
<div className="about-block">
|
||||
<div className="about-block reveal">
|
||||
<div className="about-text">
|
||||
<h2>Who We Are</h2>
|
||||
<span className="eyebrow">1998 — where it started</span>
|
||||
<h2 style={{ margin: '14px 0' }}>Who we are</h2>
|
||||
<p>
|
||||
Our journey began in 1998 as a Chartered Accountant firm in India,
|
||||
built on strong fundamentals of accounting, compliance, integrity,
|
||||
@@ -31,48 +21,57 @@ export default function AboutUs() {
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
In 2018, we strengthened our presence in Pune & Mumbai — transitioning
|
||||
from a traditional CA practice into a scalable financial services
|
||||
organization.
|
||||
In 2018, we strengthened our presence in Pune and Mumbai —
|
||||
transitioning from a traditional CA practice into a scalable
|
||||
financial services organization.
|
||||
</p>
|
||||
</div>
|
||||
<img className="about-img" src="/images/about-us-block-1.webp" alt="Bookkeepro Team" style={{ objectFit: 'cover' }} />
|
||||
<img className="about-img" src="/images/about-us-block-1.webp" alt="BookKeepPro Team" />
|
||||
</div>
|
||||
|
||||
<div className="about-block reverse">
|
||||
<div className="about-block reverse reveal">
|
||||
<div className="about-text">
|
||||
<h2>About Bookkeepro</h2>
|
||||
<span className="eyebrow">2023 — going global</span>
|
||||
<h2 style={{ margin: '14px 0' }}>About BookKeepPro</h2>
|
||||
<p>
|
||||
As our client base expanded globally — especially across the US — we aligned
|
||||
our operating model to support international growth.
|
||||
As our client base expanded globally — especially across the US —
|
||||
we aligned our operating model to support international growth.
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
In 2023, we launched:<br /><br />
|
||||
<b>• Bookkeeping Business Solutions Pvt Ltd (India)</b><br />
|
||||
<b>• Bookkeeping Business Solutions LLC (USA)</b>
|
||||
<b>Bookkeeping Business Solutions Pvt Ltd</b> (India)<br />
|
||||
<b>Bookkeeping Business Solutions LLC</b> (USA)
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
Today, Bookkeepro serves global businesses, startups & enterprises with
|
||||
scalable, compliant bookkeeping and financial operations support.
|
||||
Today, BookKeepPro serves global businesses, startups and
|
||||
enterprises with scalable, compliant bookkeeping and financial
|
||||
operations support.
|
||||
</p>
|
||||
</div>
|
||||
<img className="about-img" src="/images/young-business-people-using-computer-in-office.jpg" alt="About Bookkeepro" style={{ objectFit: 'cover' }} />
|
||||
<img className="about-img" src="/images/young-business-people-using-computer-in-office.jpg" alt="About BookKeepPro" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="about-block" style={{ width: 'min(1200px, 92%)', margin: 'auto', marginBottom: '80px', padding: '40px', justifyContent: 'center', textAlign: 'center', flexWrap: 'wrap' }}>
|
||||
<div className="about-text" style={{ flex: '1 1 100%' }}>
|
||||
<h2 style={{ marginBottom: '24px' }}>Who We Are Today</h2>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '20px', justifyContent: 'center' }}>
|
||||
<p style={{ background: 'var(--blue-light)', color: 'var(--navy)', padding: '12px 24px', borderRadius: '30px', fontWeight: '500' }}>✔️ 25+ years of accounting & compliance expertise</p>
|
||||
<p style={{ background: 'var(--blue-light)', color: 'var(--navy)', padding: '12px 24px', borderRadius: '30px', fontWeight: '500' }}>✔️ Operations across India & USA</p>
|
||||
<p style={{ background: 'var(--blue-light)', color: 'var(--navy)', padding: '12px 24px', borderRadius: '30px', fontWeight: '500' }}>✔️ Secure, process-driven financial workflows</p>
|
||||
<p style={{ background: 'var(--blue-light)', color: 'var(--navy)', padding: '12px 24px', borderRadius: '30px', fontWeight: '500' }}>✔️ Strong confidentiality & data protection practices</p>
|
||||
</div>
|
||||
<section className="section reveal" style={{ marginTop: 0, marginBottom: '90px' }}>
|
||||
<div className="section-head" style={{ textAlign: 'center', margin: '0 auto 32px', maxWidth: '640px' }}>
|
||||
<span className="eyebrow" style={{ justifyContent: 'center' }}>Where we stand today</span>
|
||||
<h2>Who we are today</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', justifyContent: 'center' }}>
|
||||
{[
|
||||
'27+ years of accounting & compliance expertise',
|
||||
'Operations across India and the USA',
|
||||
'Secure, process-driven financial workflows',
|
||||
'Strong confidentiality & data protection practices',
|
||||
].map((item) => (
|
||||
<p key={item} className="badge badge-blue" style={{ padding: '12px 22px', fontSize: '13.5px', fontWeight: 500, letterSpacing: 0 }}>
|
||||
{item}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
export default function AdminDashboard() {
|
||||
const { user, authFetch } = useAuth();
|
||||
const [stats, setStats] = useState({ total_users: 0, pending_docs: 0, admins: 0 });
|
||||
const { authFetch } = useAuth();
|
||||
const [stats, setStats] = useState({ total_users: 0, pending_personal: 0, pending_business: 0, admins: 0 });
|
||||
const [users, setUsers] = useState([]);
|
||||
const [search, setSearch] = useState("");
|
||||
const [tab, setTab] = useState("users");
|
||||
@@ -19,17 +19,7 @@ export default function AdminDashboard() {
|
||||
const [tplFile, setTplFile] = useState(null);
|
||||
const [tplLoading, setTplLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetchAdminData();
|
||||
}, [authFetch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (tab === "templates") {
|
||||
loadTemplates();
|
||||
}
|
||||
}, [tab, tplCategory, tplYear]);
|
||||
|
||||
const fetchAdminData = async () => {
|
||||
const fetchAdminData = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await authFetch("/api/auth/admin/users");
|
||||
@@ -39,21 +29,22 @@ export default function AdminDashboard() {
|
||||
const usersArray = Array.isArray(payload) ? payload : (payload.users || []);
|
||||
setUsers(usersArray);
|
||||
|
||||
// Compute stats locally like legacy frontend
|
||||
const total = usersArray.length;
|
||||
const pending = usersArray.reduce((s, u) => s + (u.pending_docs || 0), 0);
|
||||
const admins = usersArray.filter(u => u.role === "admin" || u.role === "super_admin").length;
|
||||
// Compute stats locally
|
||||
const total = usersArray.length;
|
||||
const pendingP = usersArray.reduce((s, u) => s + (u.pending_personal || 0), 0);
|
||||
const pendingB = usersArray.reduce((s, u) => s + (u.pending_business || 0), 0);
|
||||
const admins = usersArray.filter(u => u.role === "admin" || u.role === "super_admin").length;
|
||||
|
||||
setStats({ total_users: total, pending_docs: pending, admins: admins });
|
||||
setStats({ total_users: total, pending_personal: pendingP, pending_business: pendingB, admins: admins });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [authFetch]);
|
||||
|
||||
const loadTemplates = async () => {
|
||||
const loadTemplates = useCallback(async () => {
|
||||
setTplLoading(true);
|
||||
try {
|
||||
const res = await authFetch(`/api/upload/templates?category=${tplCategory}&tax_year=${tplYear}`);
|
||||
@@ -68,7 +59,17 @@ export default function AdminDashboard() {
|
||||
} finally {
|
||||
setTplLoading(false);
|
||||
}
|
||||
};
|
||||
}, [authFetch, tplCategory, tplYear]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchAdminData();
|
||||
}, [authFetch, fetchAdminData]);
|
||||
|
||||
useEffect(() => {
|
||||
if (tab === "templates") {
|
||||
loadTemplates();
|
||||
}
|
||||
}, [tab, tplCategory, tplYear, loadTemplates]);
|
||||
|
||||
const handleTplUpload = async (e) => {
|
||||
e.preventDefault();
|
||||
@@ -168,9 +169,14 @@ export default function AdminDashboard() {
|
||||
<div className="stat-label">Admin Accounts</div>
|
||||
</div>
|
||||
<div className="stat-card accent-orange">
|
||||
<div className="stat-icon"><span className="material-symbols-outlined">pending</span></div>
|
||||
<div className="stat-value">{stats.pending_docs}</div>
|
||||
<div className="stat-label">Pending Docs</div>
|
||||
<div className="stat-icon"><span className="material-symbols-outlined">description</span></div>
|
||||
<div className="stat-value">{stats.pending_personal}</div>
|
||||
<div className="stat-label">Pending Personal</div>
|
||||
</div>
|
||||
<div className="stat-card accent-orange">
|
||||
<div className="stat-icon"><span className="material-symbols-outlined">business</span></div>
|
||||
<div className="stat-value">{stats.pending_business}</div>
|
||||
<div className="stat-label">Pending Business</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -199,8 +205,17 @@ export default function AdminDashboard() {
|
||||
<span className={`badge role-badge ${u.role === 'super_admin' ? 'badge-red' : u.role === 'admin' ? 'badge-orange' : 'badge-blue'}`}>
|
||||
{u.role}
|
||||
</span>
|
||||
{u.pending_docs > 0 && (
|
||||
<span className="badge badge-orange pulse" style={{ cursor: 'default' }}>{u.pending_docs} pending</span>
|
||||
{u.pending_personal > 0 && (
|
||||
<span className="badge badge-orange pulse" style={{ cursor: 'default' }}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle'}}>description</span>
|
||||
{' '}{u.pending_personal} personal
|
||||
</span>
|
||||
)}
|
||||
{u.pending_business > 0 && (
|
||||
<span className="badge badge-orange pulse" style={{ cursor: 'default' }}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle'}}>business</span>
|
||||
{' '}{u.pending_business} business
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="click-layer"></div>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { useSearchParams, useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import ExpandableSummaryBlock from '../components/ExpandableSummaryBlock';
|
||||
|
||||
export default function AdminUserDetail() {
|
||||
const [searchParams] = useSearchParams();
|
||||
@@ -13,7 +14,7 @@ export default function AdminUserDetail() {
|
||||
const [userDetail, setUserDetail] = useState(null);
|
||||
const [documents, setDocuments] = useState([]);
|
||||
const [activeTab, setActiveTab] = useState('personal');
|
||||
const [taxYear, setTaxYear] = useState(new Date().getFullYear().toString());
|
||||
const [taxYear, setTaxYear] = useState("");
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
// States for Review Emails
|
||||
@@ -26,15 +27,7 @@ export default function AdminUserDetail() {
|
||||
|
||||
const adminDocInputRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!userId) {
|
||||
navigate('/admin-dashboard');
|
||||
return;
|
||||
}
|
||||
fetchUserDetails();
|
||||
}, [userId, taxYear]);
|
||||
|
||||
const fetchUserDetails = async () => {
|
||||
const fetchUserDetails = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const url = taxYear ? `/api/upload/admin/users/${userId}/documents?tax_year=${taxYear}` : `/api/upload/admin/users/${userId}/documents`;
|
||||
@@ -47,15 +40,35 @@ export default function AdminUserDetail() {
|
||||
|
||||
const payload = await res.json();
|
||||
setUserDetail(payload.user);
|
||||
setDocuments(payload.documents || []);
|
||||
|
||||
// Map 'table' to 'type' for personal and business docs
|
||||
const userDocs = (payload.documents || []).map(d => ({ ...d, type: d.table }));
|
||||
|
||||
// Fetch admin docs separately
|
||||
const adminDocsRes = await authFetch(`/api/upload/admin-documents?user_id=${userId}`);
|
||||
let adminDocs = [];
|
||||
if (adminDocsRes.ok) {
|
||||
adminDocs = await adminDocsRes.json();
|
||||
adminDocs = adminDocs.map(d => ({ ...d, type: 'admin', uploaded_at: d.created_at }));
|
||||
}
|
||||
|
||||
setDocuments([...userDocs, ...adminDocs]);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [authFetch, navigate, taxYear, userId]);
|
||||
|
||||
const loadAuditLog = async () => {
|
||||
useEffect(() => {
|
||||
if (!userId) {
|
||||
navigate('/admin-dashboard');
|
||||
return;
|
||||
}
|
||||
fetchUserDetails();
|
||||
}, [userId, taxYear, navigate, fetchUserDetails]);
|
||||
|
||||
const loadAuditLog = useCallback(async () => {
|
||||
try {
|
||||
const res = await authFetch(`/api/auth/admin/audit-logs?user_id=${userId}&limit=30`);
|
||||
if (res.ok) {
|
||||
@@ -65,13 +78,23 @@ export default function AdminUserDetail() {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
}, [authFetch, userId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (activeTab === 'audit' && !auditLoaded) {
|
||||
loadAuditLog();
|
||||
}
|
||||
}, [activeTab]);
|
||||
}, [activeTab, auditLoaded, loadAuditLog]);
|
||||
|
||||
// Auto-refresh if any doc is still awaiting AI extraction (background task lag)
|
||||
useEffect(() => {
|
||||
const hasPending = documents.some(
|
||||
d => (d.type === 'personal' || d.type === 'business') && d.extracted_data === null
|
||||
);
|
||||
if (!hasPending) return;
|
||||
const timer = setTimeout(() => fetchUserDetails(), 5000);
|
||||
return () => clearTimeout(timer);
|
||||
}, [documents, fetchUserDetails]);
|
||||
|
||||
const deleteUser = async () => {
|
||||
if (!window.confirm("WARNING: This will permanently delete this user, all their documents, and their audit history. Are you sure?")) return;
|
||||
@@ -144,6 +167,10 @@ export default function AdminUserDetail() {
|
||||
const fd = new FormData();
|
||||
fd.append("file", file);
|
||||
fd.append("user_id", userId);
|
||||
// doc_key and doc_label are required by the backend
|
||||
const label = file.name.replace(/\.[^.]+$/, ''); // strip extension for a clean label
|
||||
fd.append("doc_key", `admin_${Date.now()}`);
|
||||
fd.append("doc_label", label);
|
||||
try {
|
||||
const res = await authFetch("/api/upload/admin-documents", {
|
||||
method: "POST",
|
||||
@@ -243,9 +270,9 @@ export default function AdminUserDetail() {
|
||||
return (
|
||||
<div className="page-main-wide page-enter">
|
||||
{/* User Info Bar */}
|
||||
<div className="card" style={{marginBottom: '20px'}}>
|
||||
<div style={{display:'flex', alignItems:'center', justifyContent:'space-between', flexWrap:'wrap', gap:'16px'}}>
|
||||
<div style={{display:'flex', alignItems:'center', gap:'16px'}}>
|
||||
<div className="card aud-user-bar" style={{marginBottom: '20px'}}>
|
||||
<div className="aud-bar-inner">
|
||||
<div className="aud-bar-left">
|
||||
<div style={{width:'52px', height:'52px', borderRadius:'50%', background:'linear-gradient(135deg,var(--header-bg),var(--blue-light))', display:'flex', alignItems:'center', justifyContent:'center', fontWeight:700, fontSize:'20px', color:'var(--navy)', flexShrink:0}}>
|
||||
{(userDetail.name || "U").charAt(0).toUpperCase()}
|
||||
</div>
|
||||
@@ -271,13 +298,38 @@ export default function AdminUserDetail() {
|
||||
<span className="badge badge-yellow"><span className="material-symbols-outlined" style={{fontSize: '14px'}}>pending</span> Engagement not acknowledged</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Doc count summary */}
|
||||
<div style={{display:'flex', gap:'12px', marginTop:'10px', flexWrap:'wrap'}}>
|
||||
<div className="doc-count-chip">
|
||||
<span className="material-symbols-outlined" style={{fontSize:'14px', color:'var(--emerald)'}}>description</span>
|
||||
<span style={{fontWeight:600, color:'var(--navy)'}}>{personalDocs.length}</span>
|
||||
<span style={{color:'var(--muted)'}}>personal</span>
|
||||
</div>
|
||||
<div className="doc-count-chip">
|
||||
<span className="material-symbols-outlined" style={{fontSize:'14px', color:'var(--brass)'}}>business</span>
|
||||
<span style={{fontWeight:600, color:'var(--navy)'}}>{businessDocs.length}</span>
|
||||
<span style={{color:'var(--muted)'}}>business</span>
|
||||
</div>
|
||||
<div className="doc-count-chip">
|
||||
<span className="material-symbols-outlined" style={{fontSize:'14px', color:'var(--muted)'}}>upload_file</span>
|
||||
<span style={{fontWeight:600, color:'var(--navy)'}}>{returnDocs.length}</span>
|
||||
<span style={{color:'var(--muted)'}}>returns</span>
|
||||
</div>
|
||||
<div className="doc-count-chip" style={{borderLeft:'1px solid var(--border)', paddingLeft:'12px'}}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'14px', color:'var(--muted)'}}>folder</span>
|
||||
<span style={{fontWeight:700, color:'var(--navy)'}}>{personalDocs.length + businessDocs.length + returnDocs.length}</span>
|
||||
<span style={{color:'var(--muted)'}}>total</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{display:'flex', gap:'10px', alignItems:'center', flexWrap:'wrap'}}>
|
||||
<div className="aud-bar-actions">
|
||||
<button className="btn btn-primary btn-sm" onClick={submitAllDocs} style={{borderRadius:'var(--radius-sm)'}}>Trigger Submit Review</button>
|
||||
<div style={{display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: '4px', marginLeft: '12px', paddingLeft: '16px', borderLeft: '1px solid var(--border)'}}>
|
||||
<div className="aud-year-picker">
|
||||
<label className="form-label" style={{margin:0, fontSize: '11px'}}>Tax Year</label>
|
||||
<select className="select-input" style={{width: 'auto', padding: '6px 12px', fontSize: '13px'}} value={taxYear} onChange={(e) => setTaxYear(e.target.value)}>
|
||||
<option value="">All Years</option>
|
||||
{yearOptions.map(y => <option key={y} value={y}>{y}</option>)}
|
||||
</select>
|
||||
</div>
|
||||
@@ -297,35 +349,59 @@ export default function AdminUserDetail() {
|
||||
{/* Tab: Personal */}
|
||||
{activeTab === 'personal' && (
|
||||
<div className="tab-panel active">
|
||||
<div style={{display:'flex', gap:'20px', flexWrap:'wrap'}}>
|
||||
<div style={{flex:2, minWidth:0}}>
|
||||
<div className="doc-review-layout">
|
||||
<div className="doc-review-main">
|
||||
<div className="card-flat">
|
||||
{personalDocs.length === 0 ? (
|
||||
<p className="text-muted">No personal documents uploaded for {taxYear}.</p>
|
||||
<p className="text-muted">No personal documents uploaded{taxYear ? ` for ${taxYear}` : ''}.</p>
|
||||
) : (
|
||||
personalDocs.map(doc => (
|
||||
<div key={doc.id} style={{ display:'flex', alignItems:'flex-start', gap:'16px', padding:'14px 0', borderBottom:'1px solid var(--border)'}}>
|
||||
<div style={{ flex:1, minWidth:0 }}>
|
||||
<div style={{ fontWeight:600, fontSize:'13px', color:'var(--navy)' }}>{doc.doc_type}</div>
|
||||
<div style={{ fontSize:'12px', color:'var(--muted)', marginTop:'2px' }}>Uploaded {new Date(doc.uploaded_at).toLocaleDateString()}</div>
|
||||
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px' }}>Notes: {doc.notes}</div>}
|
||||
{doc.review_status && (
|
||||
<div style={{ fontSize:'12px', color: doc.review_status === "approved" ? "var(--success)" : doc.review_status === "rejected" ? "var(--error)" : "var(--yellow)", marginTop:'3px', fontWeight:600, textTransform:'uppercase' }}>
|
||||
{doc.review_status}
|
||||
<div key={doc.id} className="doc-review-row">
|
||||
<div className="doc-review-row-top">
|
||||
<div className="doc-review-info">
|
||||
<div style={{ fontWeight:700, fontSize:'15px', color:'var(--navy)', lineHeight:'1.3' }}>{doc.doc_type}</div>
|
||||
<div style={{ fontSize:'12px', color:'var(--muted)', marginTop:'3px' }}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle', marginRight:'3px'}}>calendar_today</span>
|
||||
{new Date(doc.uploaded_at).toLocaleDateString('en-US', {year:'numeric', month:'short', day:'numeric'})}
|
||||
{doc.tax_year && <span style={{marginLeft:'8px', fontWeight:600, color:'var(--brass)'}}>TY {doc.tax_year}</span>}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display:'flex', alignItems:'center', gap:'8px', flexShrink:0, flexWrap:'wrap' }}>
|
||||
<button onClick={() => viewDoc(doc.storage_key)} className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}}>View</button>
|
||||
<button className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, true)}>Approve</button>
|
||||
<button className="btn btn-danger btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, false)}>Reject</button>
|
||||
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
|
||||
{doc.review_status && (
|
||||
<div style={{ marginTop:'5px' }}>
|
||||
<span className={`badge ${doc.review_status === 'approved' ? 'badge-green' : doc.review_status === 'rejected' ? 'badge-red' : 'badge-yellow'}`} style={{fontWeight:700}}>
|
||||
{doc.review_status.toUpperCase()}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="doc-review-actions">
|
||||
<button onClick={() => viewDoc(doc.storage_key)} className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}}>View</button>
|
||||
<button className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, true)}>Approve</button>
|
||||
<button className="btn btn-danger btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, false)}>Reject</button>
|
||||
</div>
|
||||
</div>
|
||||
{doc.extracted_data && Object.keys(doc.extracted_data).length > 0 ? (
|
||||
<div className="ai-summary-block">
|
||||
<div className="ai-summary-label">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '14px', verticalAlign: 'middle', marginRight: '4px' }}>auto_awesome</span>
|
||||
AI Summary
|
||||
</div>
|
||||
<ExpandableSummaryBlock extractedData={doc.extracted_data} />
|
||||
</div>
|
||||
) : doc.extracted_data === null ? (
|
||||
<div className="ai-summary-block" style={{ opacity: 0.6 }}>
|
||||
<div className="ai-summary-label">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '14px', verticalAlign: 'middle', marginRight: '4px', animation: 'spin 1.2s linear infinite' }}>progress_activity</span>
|
||||
AI Summary — Processing…
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{flex:1, minWidth:'240px'}}>
|
||||
<div className="doc-review-sidebar">
|
||||
<div className="card-flat" style={{display:'flex', flexDirection:'column', gap:'16px'}}>
|
||||
<h3>Filing Timeline</h3>
|
||||
<div className="timeline-control">
|
||||
@@ -348,35 +424,59 @@ export default function AdminUserDetail() {
|
||||
{/* Tab: Business */}
|
||||
{activeTab === 'business' && (
|
||||
<div className="tab-panel active">
|
||||
<div style={{display:'flex', gap:'20px', flexWrap:'wrap'}}>
|
||||
<div style={{flex:2, minWidth:0}}>
|
||||
<div className="doc-review-layout">
|
||||
<div className="doc-review-main">
|
||||
<div className="card-flat">
|
||||
{businessDocs.length === 0 ? (
|
||||
<p className="text-muted">No business documents uploaded for {taxYear}.</p>
|
||||
<p className="text-muted">No business documents uploaded{taxYear ? ` for ${taxYear}` : ''}.</p>
|
||||
) : (
|
||||
businessDocs.map(doc => (
|
||||
<div key={doc.id} style={{ display:'flex', alignItems:'flex-start', gap:'16px', padding:'14px 0', borderBottom:'1px solid var(--border)'}}>
|
||||
<div style={{ flex:1, minWidth:0 }}>
|
||||
<div style={{ fontWeight:600, fontSize:'13px', color:'var(--navy)' }}>{doc.doc_type}</div>
|
||||
<div style={{ fontSize:'12px', color:'var(--muted)', marginTop:'2px' }}>Uploaded {new Date(doc.uploaded_at).toLocaleDateString()}</div>
|
||||
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px' }}>Notes: {doc.notes}</div>}
|
||||
{doc.review_status && (
|
||||
<div style={{ fontSize:'12px', color: doc.review_status === "approved" ? "var(--success)" : doc.review_status === "rejected" ? "var(--error)" : "var(--yellow)", marginTop:'3px', fontWeight:600, textTransform:'uppercase' }}>
|
||||
{doc.review_status}
|
||||
<div key={doc.id} className="doc-review-row">
|
||||
<div className="doc-review-row-top">
|
||||
<div className="doc-review-info">
|
||||
<div style={{ fontWeight:700, fontSize:'15px', color:'var(--navy)', lineHeight:'1.3' }}>{doc.doc_type}</div>
|
||||
<div style={{ fontSize:'12px', color:'var(--muted)', marginTop:'3px' }}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle', marginRight:'3px'}}>calendar_today</span>
|
||||
{new Date(doc.uploaded_at).toLocaleDateString('en-US', {year:'numeric', month:'short', day:'numeric'})}
|
||||
{doc.tax_year && <span style={{marginLeft:'8px', fontWeight:600, color:'var(--brass)'}}>TY {doc.tax_year}</span>}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display:'flex', alignItems:'center', gap:'8px', flexShrink:0, flexWrap:'wrap' }}>
|
||||
<button onClick={() => viewDoc(doc.storage_key)} className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}}>View</button>
|
||||
<button className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, true)}>Approve</button>
|
||||
<button className="btn btn-danger btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, false)}>Reject</button>
|
||||
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
|
||||
{doc.review_status && (
|
||||
<div style={{ marginTop:'5px' }}>
|
||||
<span className={`badge ${doc.review_status === 'approved' ? 'badge-green' : doc.review_status === 'rejected' ? 'badge-red' : 'badge-yellow'}`} style={{fontWeight:700}}>
|
||||
{doc.review_status.toUpperCase()}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="doc-review-actions">
|
||||
<button onClick={() => viewDoc(doc.storage_key)} className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}}>View</button>
|
||||
<button className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, true)}>Approve</button>
|
||||
<button className="btn btn-danger btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => handleDocApprove(doc.id, doc.type, false)}>Reject</button>
|
||||
</div>
|
||||
</div>
|
||||
{doc.extracted_data && Object.keys(doc.extracted_data).length > 0 ? (
|
||||
<div className="ai-summary-block">
|
||||
<div className="ai-summary-label">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '14px', verticalAlign: 'middle', marginRight: '4px' }}>auto_awesome</span>
|
||||
AI Summary
|
||||
</div>
|
||||
<ExpandableSummaryBlock extractedData={doc.extracted_data} />
|
||||
</div>
|
||||
) : doc.extracted_data === null ? (
|
||||
<div className="ai-summary-block" style={{ opacity: 0.6 }}>
|
||||
<div className="ai-summary-label">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '14px', verticalAlign: 'middle', marginRight: '4px', animation: 'spin 1.2s linear infinite' }}>progress_activity</span>
|
||||
AI Summary — Processing…
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{flex:1, minWidth:'240px'}}>
|
||||
<div className="doc-review-sidebar">
|
||||
<div className="card-flat" style={{display:'flex', flexDirection:'column', gap:'16px'}}>
|
||||
<h3>Filing Timeline</h3>
|
||||
<div className="timeline-control">
|
||||
@@ -465,10 +565,9 @@ export default function AdminUserDetail() {
|
||||
<tr key={log.id}>
|
||||
<td style={{whiteSpace:'nowrap', color:'var(--muted)'}}>{new Date(log.created_at).toLocaleString()}</td>
|
||||
<td><span className="badge badge-blue">{log.action}</span></td>
|
||||
<td>{log.details}</td>
|
||||
<td>{log.detail}</td>
|
||||
<td className="text-sm text-muted">
|
||||
{log.ip_address}<br/>
|
||||
<span style={{fontSize:'10px'}}>{log.user_agent?.substring(0, 30)}...</span>
|
||||
{log.ip_address}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function Contact() {
|
||||
body: JSON.stringify(formData)
|
||||
});
|
||||
if (!res.ok) throw new Error("Failed to send");
|
||||
alert("Message Sent! Thank you for contacting us.");
|
||||
alert("Message sent! Thank you for contacting us.");
|
||||
setFormData({
|
||||
first_name: '',
|
||||
last_name: '',
|
||||
@@ -42,110 +42,89 @@ export default function Contact() {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* HERO */}
|
||||
<div className="page-hero" style={{
|
||||
backgroundImage: 'linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("/images/home-background.jpg")',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
minHeight: '350px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
textAlign: 'center',
|
||||
color: '#fff'
|
||||
}}>
|
||||
<div>
|
||||
<h1>Get In Touch</h1>
|
||||
<div className="page-hero" style={{ '--hero-img': 'url("/images/home-background.jpg")' }}>
|
||||
<div className="page-hero-inner">
|
||||
<span className="eyebrow">Get in touch</span>
|
||||
<h1>Let's talk about your books</h1>
|
||||
<p>We'd love to hear from you. Reach out to our global teams.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section className="contact-section" style={{ border: 'none', marginTop: '60px', marginBottom: '80px' }}>
|
||||
<h2 className="contact-title" style={{ color: 'var(--navy)', marginBottom: '50px' }}>
|
||||
CONTACT <span style={{ color: 'var(--blue)' }}>BOOK</span><span style={{ color: 'var(--orange)' }}>KEEPRO</span>
|
||||
</h2>
|
||||
<section className="contact-section reveal">
|
||||
<h2 className="contact-title">Contact BookKeepPro</h2>
|
||||
<p className="contact-sub">Tell us a little about your business and we'll follow up within one business day.</p>
|
||||
|
||||
<div className="contact-container" style={{ width: '100%', maxWidth: '1000px', display: 'flex', flexWrap: 'wrap', gap: '40px', justifyContent: 'center' }}>
|
||||
<div className="contact-info" style={{ flex: '1 1 300px', display: 'flex', flexDirection: 'column', gap: '30px' }}>
|
||||
<div className="info-box usa" style={{ padding: '30px', borderRadius: '20px', boxShadow: 'var(--shadow-md)' }}>
|
||||
<h3 style={{ fontSize: '24px', marginBottom: '12px' }}>USA</h3>
|
||||
<p style={{ lineHeight: '1.6', marginBottom: '16px', opacity: 0.9 }}>2520 Indigo Dr<br />McKinney, TX<br />75072, United States</p>
|
||||
<p className="phone" style={{ display: 'flex', alignItems: 'center', gap: '10px', fontWeight: '500' }}>
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '20px' }}>call</span> +1469-796-6151
|
||||
<div className="contact-container">
|
||||
<div className="contact-info">
|
||||
<div className="info-box usa">
|
||||
<h3>USA</h3>
|
||||
<p>2520 Indigo Dr<br />McKinney, TX<br />75072, United States</p>
|
||||
<p className="phone">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>call</span> +1 469-796-6151
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="info-box ind" style={{ padding: '30px', borderRadius: '20px', boxShadow: 'var(--shadow-md)' }}>
|
||||
<h3 style={{ fontSize: '24px', marginBottom: '12px' }}>IND</h3>
|
||||
<p style={{ lineHeight: '1.6', marginBottom: '16px', opacity: 0.9 }}>508, White Square,<br />Hinjewadi Road, Pune<br />411057, India</p>
|
||||
<p className="phone" style={{ display: 'flex', alignItems: 'center', gap: '10px', fontWeight: '500' }}>
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '20px' }}>call</span> +91 738 793 6020
|
||||
<div className="info-box ind">
|
||||
<h3>India</h3>
|
||||
<p>508, White Square,<br />Hinjewadi Road, Pune<br />411057, India</p>
|
||||
<p className="phone">
|
||||
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>call</span> +91 738 793 6020
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ flex: '1.5 1 400px' }}>
|
||||
<form className="contact-form" onSubmit={handleSubmit} style={{ padding: '40px', borderRadius: '20px', boxShadow: 'var(--shadow-lg)' }}>
|
||||
<h3 style={{ fontSize: '22px', marginBottom: '24px', color: 'var(--navy)' }}>Send us a message</h3>
|
||||
<div className="form-row" style={{ display: 'flex', gap: '20px', marginBottom: '20px' }}>
|
||||
<input
|
||||
type="text"
|
||||
name="first_name"
|
||||
placeholder="First Name"
|
||||
required
|
||||
value={formData.first_name}
|
||||
onChange={handleChange}
|
||||
style={{ flex: 1, padding: '14px', borderRadius: '8px', border: '1px solid var(--border)', outline: 'none' }}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
name="last_name"
|
||||
placeholder="Last Name"
|
||||
required
|
||||
value={formData.last_name}
|
||||
onChange={handleChange}
|
||||
style={{ flex: 1, padding: '14px', borderRadius: '8px', border: '1px solid var(--border)', outline: 'none' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
placeholder="Email Address"
|
||||
required
|
||||
value={formData.email}
|
||||
<form className="contact-form" onSubmit={handleSubmit}>
|
||||
<h3 style={{ marginBottom: '22px' }}>Send us a message</h3>
|
||||
<div className="form-row">
|
||||
<input
|
||||
type="text"
|
||||
name="first_name"
|
||||
placeholder="First name"
|
||||
required
|
||||
value={formData.first_name}
|
||||
onChange={handleChange}
|
||||
style={{ width: '100%', padding: '14px', borderRadius: '8px', border: '1px solid var(--border)', outline: 'none', marginBottom: '20px' }}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
name="last_name"
|
||||
placeholder="Last name"
|
||||
required
|
||||
value={formData.last_name}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="phone-row" style={{ marginBottom: '20px', border: 'none', padding: 0 }}>
|
||||
<input
|
||||
type="text"
|
||||
name="phone"
|
||||
placeholder="Mobile Number"
|
||||
required
|
||||
value={formData.phone}
|
||||
onChange={handleChange}
|
||||
style={{ width: '100%', padding: '14px', borderRadius: '8px', border: '1px solid var(--border)', outline: 'none' }}
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
placeholder="Email address"
|
||||
required
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
|
||||
<div className="message-row">
|
||||
<textarea
|
||||
name="message"
|
||||
placeholder="How can we help you?"
|
||||
required
|
||||
style={{ width: '100%', padding: '14px', border: '1px solid var(--border)', borderRadius: '8px', fontFamily: 'inherit', fontSize: '15px', outline: 'none', marginBottom: '24px', resize: 'vertical', minHeight: '120px' }}
|
||||
value={formData.message}
|
||||
onChange={handleChange}
|
||||
></textarea>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
name="phone"
|
||||
placeholder="Mobile number"
|
||||
required
|
||||
value={formData.phone}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
|
||||
<button type="submit" disabled={loading} className="btn btn-primary" style={{ width: '100%', padding: '14px', fontSize: '16px', borderRadius: '30px' }}>
|
||||
{loading ? 'SENDING...' : 'SEND MESSAGE'}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<textarea
|
||||
name="message"
|
||||
placeholder="How can we help you?"
|
||||
required
|
||||
style={{ minHeight: '120px' }}
|
||||
value={formData.message}
|
||||
onChange={handleChange}
|
||||
></textarea>
|
||||
|
||||
<button type="submit" disabled={loading} className="btn btn-primary w-full">
|
||||
{loading ? 'Sending…' : 'Send message'}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
|
||||
+86
-53
@@ -1,76 +1,109 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const SERVICES = [
|
||||
{
|
||||
label: 'Bookkeeping',
|
||||
title: 'Monthly books, closed clean and on time',
|
||||
img: '/images/services-1.jpg',
|
||||
},
|
||||
{
|
||||
label: 'Payroll',
|
||||
title: 'Payroll runs your team can set a clock by',
|
||||
img: '/images/services-2.jpg',
|
||||
},
|
||||
{
|
||||
label: 'Tax',
|
||||
title: 'Tax planning and prep built around your entity',
|
||||
img: '/images/services-3.jpg',
|
||||
},
|
||||
];
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<>
|
||||
{/* ================= HERO ================= */}
|
||||
<div className="home-hero" style={{
|
||||
backgroundImage: 'linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url("/images/home-background.jpg")',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
minHeight: '600px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
textAlign: 'center',
|
||||
color: '#fff',
|
||||
padding: '20px'
|
||||
}}>
|
||||
<div style={{ maxWidth: '800px' }}>
|
||||
<h1 style={{ fontSize: 'clamp(32px, 5vw, 56px)', fontWeight: '700', marginBottom: '20px', color: '#fff' }}>PRECISION | COMPLIANCE | FINANCIAL GROWTH</h1>
|
||||
<p style={{ fontSize: 'clamp(18px, 2vw, 24px)', marginBottom: '30px', color: '#e2eaf2' }}>Your Trusted Bookkeeping & Financial Operations Partner for Growing Businesses</p>
|
||||
<Link to="/contact">
|
||||
<button className="btn btn-primary" style={{ padding: '12px 32px', fontSize: '18px', borderRadius: '30px' }}>Get Started</button>
|
||||
</Link>
|
||||
<div className="hero">
|
||||
<div className="hero-inner reveal in-view">
|
||||
<span className="hero-eyebrow">Bookkeeping · Payroll · Tax</span>
|
||||
<h1>Every entry accounted for. <em>Every deadline kept.</em></h1>
|
||||
<p className="hero-sub">
|
||||
BookKeepPro handles the books, the payroll and the filings for growing
|
||||
businesses across the US and India, so nothing slips between the cracks
|
||||
of a busy quarter.
|
||||
</p>
|
||||
<div className="hero-actions">
|
||||
<Link to="/contact"><button className="btn btn-primary">Get started</button></Link>
|
||||
<Link to="/services"><button className="btn btn-outline" style={{ borderColor: 'rgba(255,255,255,0.5)', color: '#fff' }}>See our services</button></Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="hero-stats">
|
||||
<div className="stat-block">
|
||||
<div className="stat-figure tnum">27</div>
|
||||
<div className="stat-caption">Years in accounting</div>
|
||||
</div>
|
||||
<div className="stat-block">
|
||||
<div className="stat-figure tnum">2</div>
|
||||
<div className="stat-caption">Countries operating</div>
|
||||
</div>
|
||||
<div className="stat-block">
|
||||
<div className="stat-figure tnum">100%</div>
|
||||
<div className="stat-caption">Filings on schedule</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ================= ABOUT ================= */}
|
||||
<section className="about-section" style={{ display: 'flex', gap: '40px', padding: '80px 20px', maxWidth: '1200px', margin: '0 auto', alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<div className="text" style={{ flex: '1 1 500px' }}>
|
||||
<h2 style={{ fontSize: '36px', marginBottom: '24px' }}>
|
||||
We are <span style={{ color: '#0077C8' }}>BOOK</span><span style={{ color: '#FF7F11' }}>KEEPRO</span>
|
||||
</h2>
|
||||
<p style={{ fontSize: '16px', lineHeight: '1.8', marginBottom: '16px' }}>
|
||||
Our journey began in 1998 as a Chartered Accountant firm in India, built on strong fundamentals of accounting, compliance, integrity, and long-term client relationships. Over the years, we earned the trust of businesses by delivering accurate, compliant, and dependable financial services.
|
||||
<section className="section about-grid reveal">
|
||||
<div className="about-copy">
|
||||
<span className="eyebrow">Who we are</span>
|
||||
<h2 style={{ marginTop: '14px', marginBottom: '20px' }}>Twenty-seven years of getting the numbers right</h2>
|
||||
<p>
|
||||
Our journey began in 1998 as a Chartered Accountant firm in India, built
|
||||
on strong fundamentals of accounting, compliance, integrity, and
|
||||
long-term client relationships.
|
||||
</p>
|
||||
<p style={{ fontSize: '16px', lineHeight: '1.8', marginBottom: '24px' }}>
|
||||
In 2018, responding to growing demand and an expanding client base, we strengthened our presence by establishing operations in Pune and Mumbai, two of India’s major business hubs. This phase marked our evolution from a traditional CA practice into a more structured, process-driven financial services organization.
|
||||
<p>
|
||||
In 2018, responding to growing demand, we expanded into Pune and
|
||||
Mumbai — evolving from a traditional CA practice into a structured,
|
||||
process-driven financial services organization.
|
||||
</p>
|
||||
<p className="note" style={{ fontStyle: 'italic', color: 'var(--muted)', fontWeight: '500' }}>-- Our People Are Passionate About What We Do</p>
|
||||
<p className="note">— Our people are passionate about what we do</p>
|
||||
</div>
|
||||
<div style={{ flex: '1 1 400px' }}>
|
||||
<img src="/images/home-about.jpg" alt="About BookKeepPro" style={{ width: '100%', borderRadius: '20px', boxShadow: 'var(--shadow-lg)', objectFit: 'cover' }} />
|
||||
<div className="about-media">
|
||||
<img src="/images/home-about.jpg" alt="BookKeepPro team at work" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* ================= SERVICES ================= */}
|
||||
<section className="services-section">
|
||||
<h2>OUR SERVICES</h2>
|
||||
<div className="services-grid">
|
||||
<div className="service-card" style={{ flex: '1 1 300px' }}>
|
||||
<img src="/images/services-1.jpg" alt="Bookkeeping" style={{ width: '100%', height: '220px', objectFit: 'cover', borderTopLeftRadius: '15px', borderTopRightRadius: '15px' }} />
|
||||
<div style={{ padding: '24px' }}>
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '16px' }}>Professional Bookkeeping for Firms & Businesses</h3>
|
||||
<Link to="/contact"><button className="btn btn-outline" style={{ width: '100%' }}>Get Consultation</button></Link>
|
||||
<section className="section reveal">
|
||||
<div className="section-head">
|
||||
<span className="eyebrow">What we handle</span>
|
||||
<h2>The three ledgers every business runs on</h2>
|
||||
</div>
|
||||
<div className="services-grid stagger">
|
||||
{SERVICES.map((s) => (
|
||||
<div className="service-card fade-up" key={s.label}>
|
||||
<div className="service-media">
|
||||
<img src={s.img} alt={s.title} />
|
||||
</div>
|
||||
<div className="service-body">
|
||||
<span className="service-label">{s.label}</span>
|
||||
<h3>{s.title}</h3>
|
||||
<Link to="/contact"><button className="btn btn-outline btn-sm w-full">Get consultation</button></Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="service-card" style={{ flex: '1 1 300px' }}>
|
||||
<img src="/images/services-2.jpg" alt="Payroll" style={{ width: '100%', height: '220px', objectFit: 'cover', borderTopLeftRadius: '15px', borderTopRightRadius: '15px' }} />
|
||||
<div style={{ padding: '24px' }}>
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '16px' }}>Professional & Globally Trusted Payroll Solutions</h3>
|
||||
<Link to="/contact"><button className="btn btn-outline" style={{ width: '100%' }}>Get Consultation</button></Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="service-card" style={{ flex: '1 1 300px' }}>
|
||||
<img src="/images/services-3.jpg" alt="Tax Planning" style={{ width: '100%', height: '220px', objectFit: 'cover', borderTopLeftRadius: '15px', borderTopRightRadius: '15px' }} />
|
||||
<div style={{ padding: '24px' }}>
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '16px' }}>Professional Tax Planning & Preparation</h3>
|
||||
<Link to="/contact"><button className="btn btn-outline" style={{ width: '100%' }}>Get Consultation</button></Link>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* ================= CTA ================= */}
|
||||
<div className="cta-band reveal">
|
||||
<span className="eyebrow" style={{ justifyContent: 'center', color: '#E4C98A' }}>Ready when you are</span>
|
||||
<h2 style={{ marginTop: '14px' }}>Hand us the receipts. We'll handle the rest.</h2>
|
||||
<p>Book a short call and we'll map out exactly what your books need this quarter.</p>
|
||||
<Link to="/contact"><button className="btn btn-primary">Talk to us</button></Link>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,67 +1,59 @@
|
||||
export default function Services() {
|
||||
return (
|
||||
<>
|
||||
{/* HERO */}
|
||||
<div className="page-hero" style={{
|
||||
backgroundImage: 'linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url("/images/Services-background-image.webp")',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
minHeight: '400px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
textAlign: 'center',
|
||||
color: '#fff'
|
||||
}}>
|
||||
<h1>Professional Services for Firms & Businesses</h1>
|
||||
<div className="page-hero" style={{ '--hero-img': 'url("/images/Services-background-image.webp")' }}>
|
||||
<div className="page-hero-inner">
|
||||
<span className="eyebrow">What we do</span>
|
||||
<h1>Professional services for firms and businesses</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* SERVICE CONTENT */}
|
||||
<div className="services-wrapper">
|
||||
{/* Block 1 */}
|
||||
<div className="service-block">
|
||||
<div className="service-block reveal">
|
||||
<div className="service-text">
|
||||
<h2>For Accounting Firms and Businesses</h2>
|
||||
<span className="eyebrow">Offshore delivery</span>
|
||||
<h2>For accounting firms and businesses</h2>
|
||||
<p>
|
||||
Bookkeepro India specialises in its offshore delivery model and consists of a strong team of qualified
|
||||
accountants, cost accountants, tax consultants and payroll experts to ease the bookkeeping for Accounting
|
||||
Firms and Businesses, globally.
|
||||
BookKeepPro India specialises in its offshore delivery model and
|
||||
consists of a strong team of qualified accountants, cost
|
||||
accountants, tax consultants and payroll experts to ease the
|
||||
bookkeeping for accounting firms and businesses, globally.
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
Bookkeepro’s India based offshore bookkeeping services offer several benefits
|
||||
to global accounting firms and businesses.
|
||||
Our India-based offshore bookkeeping services offer several
|
||||
benefits to global accounting firms and businesses.
|
||||
</p>
|
||||
</div>
|
||||
<img className="service-img" src="/images/services-3.jpg" alt="Accounting Outsourcing" style={{ borderRadius: '14px', objectFit: 'cover' }} />
|
||||
<img className="service-img" src="/images/services-3.jpg" alt="Accounting Outsourcing" />
|
||||
</div>
|
||||
|
||||
{/* Block 2 */}
|
||||
<div className="service-block reverse">
|
||||
<div className="service-block reverse reveal">
|
||||
<div className="service-text">
|
||||
<h2>Scale Your Business with Accounting Outsourcing</h2>
|
||||
<span className="eyebrow">Accounting outsourcing</span>
|
||||
<h2>Scale your business with outsourcing</h2>
|
||||
<p>
|
||||
Are you ready to supercharge your business and take it to new heights?
|
||||
We understand that managing finances and accounting can be a complex and
|
||||
time-consuming task, often diverting your focus away from what truly matters —
|
||||
growing your business.
|
||||
Managing finances and accounting can be a complex and
|
||||
time-consuming task, often diverting your focus away from what
|
||||
truly matters — growing your business.
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
That’s where we come in. Allow us to present the game-changing solution:
|
||||
Accounting Outsourcing.
|
||||
That's where we come in: a bookkeeping team that runs in the
|
||||
background so yours doesn't have to.
|
||||
</p>
|
||||
</div>
|
||||
<img className="service-img-bl-3" src="/images/services-2.jpg" alt="Outsourced Accounting Team" style={{ borderRadius: '14px', objectFit: 'cover' }} />
|
||||
<img className="service-img-bl-3" src="/images/services-2.jpg" alt="Outsourced Accounting Team" />
|
||||
</div>
|
||||
|
||||
{/* Block 3 */}
|
||||
<div className="service-block">
|
||||
<div className="service-block reveal">
|
||||
<div className="service-text">
|
||||
<h2>Tax Planning And Preparation</h2>
|
||||
<span className="eyebrow">Tax planning</span>
|
||||
<h2>Tax planning and preparation</h2>
|
||||
<p>
|
||||
We help individuals and businesses optimize tax strategy and get returns prepared right and on time.
|
||||
Whether your business is an LLC, S-Corp, or C-Corp, we’ll help you:
|
||||
We help individuals and businesses optimize tax strategy and get
|
||||
returns prepared right and on time. Whether your business is an
|
||||
LLC, S-Corp, or C-Corp, we'll help you:
|
||||
</p>
|
||||
<ol className="list-items">
|
||||
<li>Comply with and leverage changing federal tax law</li>
|
||||
@@ -72,12 +64,11 @@ export default function Services() {
|
||||
</ol>
|
||||
<br />
|
||||
<p>
|
||||
By minimizing your tax liability, you maximize your after-tax cash flow,
|
||||
which helps create financial security. We want you confident in knowing you
|
||||
have the right proactive tax plan in place.
|
||||
By minimizing your tax liability, you maximize your after-tax
|
||||
cash flow — the foundation of a proactive, confident tax plan.
|
||||
</p>
|
||||
</div>
|
||||
<img className="service-img" src="/images/services-1.jpg" alt="Tax Services" style={{ borderRadius: '14px', objectFit: 'cover' }} />
|
||||
<img className="service-img" src="/images/services-1.jpg" alt="Tax Services" />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, useRef } from 'react';
|
||||
import { useEffect, useState, useRef, useCallback } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
@@ -13,11 +13,7 @@ export default function UploadBusiness() {
|
||||
const fileInputRefs = useRef({});
|
||||
const extraFileRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
fetchTemplatesAndDocs();
|
||||
}, [taxYear]);
|
||||
|
||||
const fetchTemplatesAndDocs = async () => {
|
||||
const fetchTemplatesAndDocs = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const tplRes = await authFetch(`/api/upload/templates?category=business&tax_year=${taxYear}`);
|
||||
@@ -34,9 +30,13 @@ export default function UploadBusiness() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [authFetch, taxYear]);
|
||||
|
||||
const uploadFile = async (file, docType) => {
|
||||
useEffect(() => {
|
||||
fetchTemplatesAndDocs();
|
||||
}, [taxYear, fetchTemplatesAndDocs]);
|
||||
|
||||
const uploadFile = async (file, docType, skipFetch = false) => {
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
showToast("File size exceeds 10MB limit", "error");
|
||||
return;
|
||||
@@ -52,7 +52,7 @@ export default function UploadBusiness() {
|
||||
});
|
||||
if (res.ok) {
|
||||
showToast("Document uploaded successfully", "success");
|
||||
fetchTemplatesAndDocs();
|
||||
if (!skipFetch) fetchTemplatesAndDocs();
|
||||
} else {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
showToast(data.detail || "Upload failed", "error");
|
||||
@@ -93,12 +93,20 @@ export default function UploadBusiness() {
|
||||
|
||||
const handleExtraUpload = async (e) => {
|
||||
const files = Array.from(e.target.files);
|
||||
const validFiles = [];
|
||||
for (let file of files) {
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
showToast(`File ${file.name} exceeds 10MB limit`, "error");
|
||||
continue;
|
||||
}
|
||||
await uploadFile(file, "other");
|
||||
validFiles.push(file);
|
||||
}
|
||||
|
||||
if (validFiles.length > 0) {
|
||||
await Promise.all(validFiles.map((file, idx) =>
|
||||
uploadFile(file, `other_${Date.now()}_${idx}`, true)
|
||||
));
|
||||
fetchTemplatesAndDocs();
|
||||
}
|
||||
e.target.value = "";
|
||||
};
|
||||
@@ -172,7 +180,12 @@ export default function UploadBusiness() {
|
||||
hidden
|
||||
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx"
|
||||
ref={el => fileInputRefs.current[dt.name] = el}
|
||||
onChange={(e) => e.target.files[0] && uploadFile(e.target.files[0], dt.name)}
|
||||
onChange={(e) => {
|
||||
if (e.target.files[0]) {
|
||||
uploadFile(e.target.files[0], dt.name);
|
||||
e.target.value = null;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div style={{display: 'flex', gap: '8px', alignItems: 'center'}}>
|
||||
{dt.download && (
|
||||
@@ -185,9 +198,11 @@ export default function UploadBusiness() {
|
||||
)}
|
||||
</div>
|
||||
{uploaded.map(doc => (
|
||||
<div key={doc.id} style={{display:'flex', gap:'8px'}}>
|
||||
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
|
||||
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
|
||||
<div key={doc.id} style={{display:'flex', flexDirection:'column', gap:'8px', alignItems:'flex-end'}}>
|
||||
<div style={{display:'flex', gap:'8px'}}>
|
||||
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
|
||||
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -203,30 +218,53 @@ export default function UploadBusiness() {
|
||||
<h3>Additional Documents</h3>
|
||||
<p className="text-sm" style={{marginTop:'2px'}}>Upload any supplementary business documents</p>
|
||||
</div>
|
||||
<label className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}>
|
||||
<label
|
||||
className="btn btn-secondary btn-sm"
|
||||
style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
extraFileRef.current?.click();
|
||||
}
|
||||
}}
|
||||
>
|
||||
+ Choose Files
|
||||
<input type="file" multiple hidden accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx" onChange={handleExtraUpload} />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="drop-area" style={{ border:'2px dashed #b8cfdf', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }} onClick={() => extraFileRef.current?.click()}>
|
||||
<div className="da-icon"><span className="material-symbols-outlined" style={{color: '#ffca28', fontSize: '32px'}}>folder</span></div>
|
||||
<div
|
||||
className="drop-area"
|
||||
style={{ border:'2px dashed #cfc7ad', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }}
|
||||
onClick={() => extraFileRef.current?.click()}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
extraFileRef.current?.click();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="da-icon"><span className="material-symbols-outlined" style={{color: 'var(--brass)', fontSize: '32px'}}>folder</span></div>
|
||||
<div className="da-title" style={{fontWeight: 600, color: 'var(--navy)', fontSize: '14px'}}>Drag & drop files here</div>
|
||||
<div className="da-hint" style={{fontSize: '12px', color: 'var(--muted)'}}>or click to browse · PDF, JPG, PNG, WEBP, DOC, EXCEL · Max 10MB</div>
|
||||
</div>
|
||||
<input type="file" multiple hidden ref={extraFileRef} onChange={handleExtraUpload} />
|
||||
|
||||
<div className="upload-track mt-12">
|
||||
{docs.filter(d => d.doc_type === "other").map(doc => (
|
||||
<div key={doc.id} className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'#f5f8fb', fontSize:'13px', marginBottom:'6px'}}>
|
||||
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
|
||||
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
|
||||
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
|
||||
</button>
|
||||
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
|
||||
</button>
|
||||
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
|
||||
<div key={doc.id} style={{marginBottom:'6px'}}>
|
||||
<div className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'var(--paper)', fontSize:'13px'}}>
|
||||
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
|
||||
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
|
||||
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
|
||||
</button>
|
||||
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, useRef } from 'react';
|
||||
import { useEffect, useState, useRef, useCallback } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
@@ -13,11 +13,7 @@ export default function UploadPersonal() {
|
||||
const fileInputRefs = useRef({});
|
||||
const extraFileRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
fetchTemplatesAndDocs();
|
||||
}, [taxYear]);
|
||||
|
||||
const fetchTemplatesAndDocs = async () => {
|
||||
const fetchTemplatesAndDocs = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
// Fetch required templates
|
||||
@@ -36,9 +32,13 @@ export default function UploadPersonal() {
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
}, [authFetch, taxYear]);
|
||||
|
||||
const uploadFile = async (file, docType) => {
|
||||
useEffect(() => {
|
||||
fetchTemplatesAndDocs();
|
||||
}, [taxYear, fetchTemplatesAndDocs]);
|
||||
|
||||
const uploadFile = async (file, docType, skipFetch = false) => {
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
showToast("File size exceeds 10MB limit", "error");
|
||||
return;
|
||||
@@ -54,7 +54,7 @@ export default function UploadPersonal() {
|
||||
});
|
||||
if (res.ok) {
|
||||
showToast("Document uploaded successfully", "success");
|
||||
fetchTemplatesAndDocs();
|
||||
if (!skipFetch) fetchTemplatesAndDocs();
|
||||
} else {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
showToast(data.detail || "Upload failed", "error");
|
||||
@@ -95,12 +95,20 @@ export default function UploadPersonal() {
|
||||
|
||||
const handleExtraUpload = async (e) => {
|
||||
const files = Array.from(e.target.files);
|
||||
const validFiles = [];
|
||||
for (let file of files) {
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
showToast(`File ${file.name} exceeds 10MB limit`, "error");
|
||||
continue;
|
||||
}
|
||||
await uploadFile(file, "other");
|
||||
validFiles.push(file);
|
||||
}
|
||||
|
||||
if (validFiles.length > 0) {
|
||||
await Promise.all(validFiles.map((file, idx) =>
|
||||
uploadFile(file, `other_${Date.now()}_${idx}`, true)
|
||||
));
|
||||
fetchTemplatesAndDocs();
|
||||
}
|
||||
e.target.value = "";
|
||||
};
|
||||
@@ -174,7 +182,12 @@ export default function UploadPersonal() {
|
||||
hidden
|
||||
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx"
|
||||
ref={el => fileInputRefs.current[dt.name] = el}
|
||||
onChange={(e) => e.target.files[0] && uploadFile(e.target.files[0], dt.name)}
|
||||
onChange={(e) => {
|
||||
if (e.target.files[0]) {
|
||||
uploadFile(e.target.files[0], dt.name);
|
||||
e.target.value = null;
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div style={{display: 'flex', gap: '8px', alignItems: 'center'}}>
|
||||
{dt.download && (
|
||||
@@ -187,9 +200,11 @@ export default function UploadPersonal() {
|
||||
)}
|
||||
</div>
|
||||
{uploaded.map(doc => (
|
||||
<div key={doc.id} style={{display:'flex', gap:'8px'}}>
|
||||
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
|
||||
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
|
||||
<div key={doc.id} style={{display:'flex', flexDirection:'column', gap:'8px', alignItems:'flex-end'}}>
|
||||
<div style={{display:'flex', gap:'8px'}}>
|
||||
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
|
||||
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -205,30 +220,53 @@ export default function UploadPersonal() {
|
||||
<h3>Additional Documents</h3>
|
||||
<p className="text-sm" style={{marginTop:'2px'}}>Upload any supplementary personal documents</p>
|
||||
</div>
|
||||
<label className="btn btn-secondary btn-sm" style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}>
|
||||
<label
|
||||
className="btn btn-secondary btn-sm"
|
||||
style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
extraFileRef.current?.click();
|
||||
}
|
||||
}}
|
||||
>
|
||||
+ Choose Files
|
||||
<input type="file" multiple hidden accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx" onChange={handleExtraUpload} />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="drop-area" style={{ border:'2px dashed #b8cfdf', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }} onClick={() => extraFileRef.current?.click()}>
|
||||
<div className="da-icon"><span className="material-symbols-outlined" style={{color: '#ffca28', fontSize: '32px'}}>folder</span></div>
|
||||
<div
|
||||
className="drop-area"
|
||||
style={{ border:'2px dashed #cfc7ad', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }}
|
||||
onClick={() => extraFileRef.current?.click()}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
extraFileRef.current?.click();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="da-icon"><span className="material-symbols-outlined" style={{color: 'var(--brass)', fontSize: '32px'}}>folder</span></div>
|
||||
<div className="da-title" style={{fontWeight: 600, color: 'var(--navy)', fontSize: '14px'}}>Drag & drop files here</div>
|
||||
<div className="da-hint" style={{fontSize: '12px', color: 'var(--muted)'}}>or click to browse · PDF, JPG, PNG, WEBP, DOC, DOCX · Max 10MB</div>
|
||||
</div>
|
||||
<input type="file" multiple hidden ref={extraFileRef} onChange={handleExtraUpload} />
|
||||
|
||||
<div className="upload-track mt-12">
|
||||
{docs.filter(d => d.doc_type === "other").map(doc => (
|
||||
<div key={doc.id} className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'#f5f8fb', fontSize:'13px', marginBottom:'6px'}}>
|
||||
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
|
||||
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
|
||||
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
|
||||
</button>
|
||||
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
|
||||
</button>
|
||||
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
|
||||
<div key={doc.id} style={{marginBottom:'6px'}}>
|
||||
<div className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'var(--paper)', fontSize:'13px'}}>
|
||||
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
|
||||
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
|
||||
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
|
||||
</button>
|
||||
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
|
||||
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useToast } from '../context/ToastContext';
|
||||
@@ -13,12 +13,9 @@ export default function UserDashboard() {
|
||||
const [loadingDocs, setLoadingDocs] = useState(false);
|
||||
const [docLoading, setDocLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
checkEngagement();
|
||||
loadAdminDocs();
|
||||
}, []);
|
||||
// ── declare callbacks BEFORE the effects that reference them ──
|
||||
|
||||
const checkEngagement = async () => {
|
||||
const checkEngagement = useCallback(async () => {
|
||||
try {
|
||||
const res = await authFetch("/api/auth/me");
|
||||
if (res.ok) {
|
||||
@@ -31,16 +28,33 @@ export default function UserDashboard() {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
}, [authFetch]);
|
||||
|
||||
const loadAdminDocs = useCallback(async () => {
|
||||
setLoadingDocs(true);
|
||||
try {
|
||||
const res = await authFetch("/api/upload/admin-documents");
|
||||
if (res.ok) {
|
||||
setAdminDocs(await res.json());
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
setLoadingDocs(false);
|
||||
}
|
||||
}, [authFetch]);
|
||||
|
||||
useEffect(() => {
|
||||
checkEngagement();
|
||||
loadAdminDocs();
|
||||
}, [checkEngagement, loadAdminDocs]);
|
||||
|
||||
const handleEngagementChange = async (e) => {
|
||||
const isChecked = e.target.checked;
|
||||
if (!isChecked) {
|
||||
// Don't allow unchecking
|
||||
setEngagementChecked(true);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setEngagementChecked(true);
|
||||
const res = await authFetch("/api/auth/acknowledge-engagement", { method: "POST" });
|
||||
@@ -55,20 +69,6 @@ export default function UserDashboard() {
|
||||
}
|
||||
};
|
||||
|
||||
const loadAdminDocs = async () => {
|
||||
setLoadingDocs(true);
|
||||
try {
|
||||
const res = await authFetch("/api/upload/admin-documents");
|
||||
if (res.ok) {
|
||||
setAdminDocs(await res.json());
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
setLoadingDocs(false);
|
||||
}
|
||||
};
|
||||
|
||||
const viewDoc = async (storageKey) => {
|
||||
try {
|
||||
const res = await authFetch(`/api/upload/view-url?key=${encodeURIComponent(storageKey)}`);
|
||||
@@ -85,13 +85,11 @@ export default function UserDashboard() {
|
||||
|
||||
const respondDoc = async (docId, approved) => {
|
||||
if (docLoading) return;
|
||||
|
||||
let reason = "";
|
||||
if (!approved) {
|
||||
reason = window.prompt("Reason for rejection:");
|
||||
if (reason === null) return;
|
||||
}
|
||||
|
||||
setDocLoading(true);
|
||||
try {
|
||||
const res = await authFetch("/api/review/admin-doc-response", {
|
||||
@@ -123,22 +121,23 @@ export default function UserDashboard() {
|
||||
<div className="card fade-up">
|
||||
<h3 style={{marginBottom: '16px'}}>Engagement Letter</h3>
|
||||
<p className="text-sm" style={{marginBottom: '16px'}}>Please acknowledge the engagement letter before uploading documents.</p>
|
||||
<div style={{
|
||||
<label style={{
|
||||
display: 'flex', alignItems: 'center', gap: '12px', padding: '16px',
|
||||
background: 'var(--bg)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--border)'
|
||||
background: 'var(--bg)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--border)',
|
||||
cursor: engagementDisabled ? 'not-allowed' : 'pointer'
|
||||
}}>
|
||||
<input
|
||||
type="checkbox"
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={engagementChecked}
|
||||
disabled={engagementDisabled}
|
||||
onChange={handleEngagementChange}
|
||||
style={{width:'20px', height:'20px', cursor: engagementDisabled ? 'not-allowed' : 'pointer'}}
|
||||
style={{width:'20px', height:'20px', cursor: engagementDisabled ? 'not-allowed' : 'pointer'}}
|
||||
/>
|
||||
<div>
|
||||
<div style={{fontWeight: 600, color: 'var(--navy)'}}>I acknowledge the Engagement Letter</div>
|
||||
<div style={{fontSize: '13px', color: 'var(--muted)', marginTop: '2px'}}>By checking this, you agree to our terms of service for the current tax year.</div>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div style={{display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '20px', marginTop: '20px'}}>
|
||||
@@ -148,23 +147,23 @@ export default function UserDashboard() {
|
||||
<h3 style={{margin:0}}>Personal Documents</h3>
|
||||
</div>
|
||||
<p className="text-sm text-muted" style={{marginBottom: '20px', minHeight: '40px'}}>Upload your W-2s, 1099s, IDs, and other individual tax forms.</p>
|
||||
<button
|
||||
className="btn btn-primary w-full"
|
||||
<button
|
||||
className="btn btn-primary w-full"
|
||||
disabled={!engagementChecked}
|
||||
onClick={() => navigate('/upload-personal')}
|
||||
>
|
||||
Go to Personal Upload
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="card fade-up" style={{animationDelay: '0.2s'}}>
|
||||
<div style={{display:'flex', alignItems:'center', gap:'12px', marginBottom: '12px'}}>
|
||||
<span className="material-symbols-outlined" style={{color:'var(--orange)', fontSize:'28px'}}>business</span>
|
||||
<h3 style={{margin:0}}>Business Documents</h3>
|
||||
</div>
|
||||
<p className="text-sm text-muted" style={{marginBottom: '20px', minHeight: '40px'}}>Upload corporate documents, bookkeeping ledgers, and business receipts.</p>
|
||||
<button
|
||||
className="btn btn-primary w-full"
|
||||
<button
|
||||
className="btn btn-primary w-full"
|
||||
disabled={!engagementChecked}
|
||||
onClick={() => navigate('/upload-business')}
|
||||
>
|
||||
@@ -176,7 +175,7 @@ export default function UserDashboard() {
|
||||
<div className="card fade-up" style={{animationDelay: '0.3s', marginTop: '20px'}}>
|
||||
<h3 style={{marginBottom: '16px'}}>Admin Returns / Documents</h3>
|
||||
<p className="text-sm" style={{marginBottom: '16px'}}>Documents and tax returns finalized by the admin.</p>
|
||||
|
||||
|
||||
{loadingDocs ? (
|
||||
<div className="empty-state">Loading documents...</div>
|
||||
) : adminDocs.length === 0 ? (
|
||||
@@ -215,4 +214,4 @@ export default function UserDashboard() {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user