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:
Atharv1705
2026-08-05 11:41:06 +05:30
parent c2e22902c8
commit 9c7f25e06f
36 changed files with 3357 additions and 5279 deletions
+126 -101
View File
@@ -6,77 +6,113 @@ const FAQ_DATA = {
"Document Review": [
{ q: "How do I review a document?", a: "From the Admin Dashboard, click on any user. You'll see their uploaded documents. Click Approve or Reject and leave a note if needed." },
{ q: "What happens when I reject a document?", a: "The document's status changes to Rejected and the user is notified. They will see your review note and can upload a corrected version to replace it." },
{ q: "How do I upload admin documents for a user?", a: "Go to the user's detail page and scroll down to Admin Documents. You can upload tax returns, reports, and other finalized forms there. These will be visible to the user." }
{ q: "How do I upload admin documents for a user?", a: "Go to the user's detail page and scroll down to Admin Documents. You can upload tax returns, reports, and other finalized forms there." }
],
"User Management": [
{ q: "How do I see user details?", a: "Simply click on any user in the Admin Dashboard table. This will take you to their detailed view where you can see their info and all their documents." },
{ q: "Can I add another admin?", a: "Currently, Super Admins can only be created via the backend script `create_super_admin.py` for security reasons." }
{ q: "How do I see user details?", a: "Click on any user in the Admin Dashboard table to open their detailed view — documents, audit trail, and filing timeline." },
{ q: "Can I add another admin?", a: "Super Admins can only be created via the backend script `create_super_admin.py` for security reasons." }
],
"Notifications": [
{ q: "How are users notified?", a: "Users receive automated emails when they sign up, when their documents are ready for review, and when you approve or reject their documents." }
{ q: "How are users notified?", a: "Users receive automated emails on signup, document submission, and when you approve or reject their documents." }
]
};
const CATEGORY_ICONS = {
"Document Review": "📑",
"User Management": "👥",
"Notifications": "🔔"
"Notifications": "🔔",
};
const formatMessage = (text) => {
if (!text) return '';
let html = text;
html = html.replace(/\*\*(.*?)\*\*/g, '<b>$1</b>');
html = html.replace(/\*(.*?)\*/g, '<i>$1</i>');
html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color: var(--blue); text-decoration: underline;">$1</a>');
html = html.replace(/\n/g, '<br/>');
return html;
return text
.replace(/\*\*(.*?)\*\*/g, '<b>$1</b>')
.replace(/\*(.*?)\*/g, '<i>$1</i>')
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--blue);text-decoration:underline">$1</a>')
.replace(/\n/g, '<br/>');
};
export default function AdminChatbot() {
const { user, authFetch } = useAuth();
const location = useLocation();
const [isOpen, setIsOpen] = useState(false);
const [messages, setMessages] = useState([]);
const [view, setView] = useState('menu');
const [isOpen, setIsOpen] = useState(false);
const [messages, setMessages] = useState([]);
const [view, setView] = useState('menu'); // menu | category | chat
const [activeCategory, setActiveCategory] = useState(null);
const [inputText, setInputText] = useState("");
const [isTyping, setIsTyping] = useState(false);
const [inputText, setInputText] = useState("");
const [menuInput, setMenuInput] = useState(""); // free-text from menu
const [isTyping, setIsTyping] = useState(false);
const chatEndRef = useRef(null);
// Close chatbot when navigating
useEffect(() => { setIsOpen(false); }, [location.pathname]);
useEffect(() => {
setIsOpen(false);
}, [location.pathname]);
useEffect(() => {
if (chatEndRef.current) {
chatEndRef.current.scrollIntoView({ behavior: 'smooth' });
}
chatEndRef.current?.scrollIntoView({ behavior: 'smooth' });
}, [messages, view]);
const toggleChat = () => setIsOpen(!isOpen);
const toggleChat = () => setIsOpen(o => !o);
/* ── quick-action: system overview ── */
const handleAdminStatusCheck = async () => {
setMessages([...messages, { type: 'user', text: 'Give me a system overview.' }]);
setMessages(prev => [...prev, { type: 'user', text: 'Give me a system overview.' }]);
setView('chat');
try {
const res = await authFetch('/api/chatbot/admin-status');
if (res.ok) {
const data = await res.json();
setMessages(prev => [...prev, { type: 'bot', text: data.message }]);
} else {
setMessages(prev => [...prev, { type: 'bot', text: 'Sorry, I could not fetch the system status right now.' }]);
setMessages(prev => [...prev, { type: 'bot', text: 'Could not fetch system status right now.' }]);
}
} catch (err) {
setMessages(prev => [...prev, { type: 'bot', text: 'Network error occurred.' }]);
} catch {
setMessages(prev => [...prev, { type: 'bot', text: 'Network error.' }]);
}
};
const selectCategory = (cat) => {
setActiveCategory(cat);
setView('category');
/* ── send a message to /ask ── */
const sendMessage = async (text, existingMessages) => {
const userMsg = { type: 'user', role: 'user', text };
const allMessages = [...(existingMessages ?? messages), userMsg];
setMessages(allMessages);
setInputText("");
setMenuInput("");
setView('chat');
setIsTyping(true);
try {
const res = await authFetch('/api/chatbot/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
messages: allMessages.map(m => ({
role: m.role || (m.type === 'bot' ? 'assistant' : 'user'),
content: m.text,
reasoning_details: null,
})),
}),
});
if (res.ok) {
const data = await res.json();
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: data.content || "Sorry, I couldn't understand that." }]);
} else {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Having trouble connecting. Please try again.' }]);
}
} catch {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error. Please try again.' }]);
} finally {
setIsTyping(false);
}
};
const handleSendMessage = async (e) => {
e.preventDefault();
if (!inputText.trim()) return;
await sendMessage(inputText.trim());
};
const handleMenuAsk = async (e) => {
e.preventDefault();
if (!menuInput.trim()) return;
await sendMessage(menuInput.trim(), []);
};
const askFaq = (faq) => {
@@ -84,139 +120,128 @@ export default function AdminChatbot() {
setView('chat');
};
const resetToMenu = () => {
setView('menu');
};
const handleSendMessage = async (e) => {
e.preventDefault();
if (!inputText.trim()) return;
const userMessage = { type: 'user', role: 'user', text: inputText.trim() };
const currentMessages = [...messages, userMessage];
setMessages(currentMessages);
setInputText("");
setView('chat');
setIsTyping(true);
try {
// Convert messages to format expected by backend
const backendMessages = currentMessages.map(m => ({
role: m.role || (m.type === 'bot' ? 'assistant' : 'user'),
content: m.text,
reasoning_details: m.reasoning_details || null
}));
const res = await authFetch('/api/chatbot/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ messages: backendMessages })
});
if (res.ok) {
const data = await res.json();
const contentText = data.content || "Sorry, I couldn't understand that.";
const reasoning = data.reasoning_details;
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: contentText, reasoning_details: reasoning }]);
} else {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Sorry, I am having trouble connecting to the server.' }]);
}
} catch (err) {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error occurred. Please try again.' }]);
} finally {
setIsTyping(false);
}
};
if (!user || (user.role !== 'admin' && user.role !== 'super_admin') || !location.pathname.startsWith('/admin')) {
return null;
return null;
}
return (
<>
<button className={`chatbot-fab ${isOpen ? 'open' : ''}`} onClick={toggleChat} aria-label="Open admin assistant" style={{background: 'linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%)'}}>
<button
className={`chatbot-fab ${isOpen ? 'open' : ''}`}
onClick={toggleChat}
aria-label="Open admin assistant"
style={{ background: 'linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%)' }}
>
<span className="fab-icon">🤖</span>
<span className="notif-dot"></span>
</button>
{isOpen && (
<div className="chatbot-window visible">
<div className="chatbot-header" style={{background: 'linear-gradient(135deg, var(--navy) 0%, #005fa3 100%)'}}>
{/* header */}
<div className="chatbot-header" style={{ background: 'var(--ink)' }}>
<div className="bot-avatar">🤖</div>
<div className="bot-info">
<h4>Admin Assistant</h4>
<span>System Insights & Help</span>
<span>Live system insights</span>
</div>
<button className="close-chat" onClick={toggleChat}>✕</button>
</div>
{/* messages area */}
<div className="chatbot-messages">
{/* ── MENU VIEW ── */}
{view === 'menu' && (
<>
<div className="chatbot-welcome-text">
<span className="material-symbols-outlined sparkle">auto_awesome</span>
<p>How can we help you today?</p>
<p>What do you need today?</p>
</div>
<button className="quick-reply-btn" style={{display: 'flex', width: '100%', marginBottom: '8px'}} onClick={handleAdminStatusCheck}>
<span className="qr-icon">📊</span>
Check System Status
{/* free-text ask from menu */}
<form onSubmit={handleMenuAsk} style={{ marginBottom: '12px', display: 'flex', gap: '6px' }}>
<input
type="text"
value={menuInput}
onChange={e => setMenuInput(e.target.value)}
placeholder="Ask anything… e.g. who uploaded today?"
style={{ flex: 1, padding: '8px 12px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', background: 'var(--card)', color: 'var(--navy)', fontSize: '13px' }}
/>
<button type="submit" style={{ background: 'var(--emerald)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 14px', cursor: 'pointer', fontSize: '13px' }}>
Ask
</button>
</form>
<button className="quick-reply-btn" style={{ display: 'flex', width: '100%', marginBottom: '8px' }} onClick={handleAdminStatusCheck}>
<span className="qr-icon">📊</span> System Overview
</button>
{Object.keys(FAQ_DATA).map(cat => (
<button key={cat} className="quick-reply-btn" style={{display: 'flex', width: '100%', marginBottom: '8px'}} onClick={() => selectCategory(cat)}>
<span className="qr-icon">{CATEGORY_ICONS[cat]}</span> {cat} FAQ
<button key={cat} className="quick-reply-btn" style={{ display: 'flex', width: '100%', marginBottom: '8px' }} onClick={() => { setActiveCategory(cat); setView('category'); }}>
<span className="qr-icon">{CATEGORY_ICONS[cat]}</span> {cat}
</button>
))}
</>
)}
{/* ── CATEGORY VIEW ── */}
{view === 'category' && (
<>
<button className="quick-reply-btn" style={{display: 'flex', width: '100%', marginBottom: '16px', background: 'transparent', border: 'none'}} onClick={resetToMenu}>← Back to menu</button>
<h4 style={{margin:'0 0 12px', fontSize:'14px', color:'var(--navy)'}}>{activeCategory} Questions</h4>
<button className="quick-reply-btn" style={{ display: 'flex', width: '100%', marginBottom: '16px', background: 'transparent', border: 'none' }} onClick={() => setView('menu')}>
← Back to menu
</button>
<h4 style={{ margin: '0 0 12px', fontSize: '14px', color: 'var(--navy)' }}>{activeCategory}</h4>
{FAQ_DATA[activeCategory].map((faq, i) => (
<button key={i} className="quick-reply-btn" style={{display: 'flex', width: '100%', marginBottom: '8px'}} onClick={() => askFaq(faq)}>
<button key={i} className="quick-reply-btn" style={{ display: 'flex', width: '100%', marginBottom: '8px' }} onClick={() => askFaq(faq)}>
{faq.q}
</button>
))}
</>
)}
{/* ── CHAT VIEW ── */}
{view === 'chat' && (
<>
<button className="quick-reply-btn" onClick={resetToMenu} style={{display: 'flex', width: '100%', marginBottom: '16px', background: 'transparent', border: 'none'}}>
<button className="quick-reply-btn" onClick={() => setView('menu')} style={{ display: 'flex', width: '100%', marginBottom: '16px', background: 'transparent', border: 'none' }}>
← Back to menu
</button>
{messages.map((msg, i) => (
<div key={i} className={`chat-msg ${msg.type === 'bot' ? 'bot' : 'user'}`}
{...(msg.type === 'bot' ? { dangerouslySetInnerHTML: { __html: formatMessage(msg.text) } } : { children: msg.text })}
<div
key={i}
className={`chat-msg ${msg.type === 'bot' ? 'bot' : 'user'}`}
{...(msg.type === 'bot'
? { dangerouslySetInnerHTML: { __html: formatMessage(msg.text) } }
: { children: msg.text })}
/>
))}
{isTyping && (
<div className="chat-msg bot" style={{ fontStyle: 'italic', opacity: 0.7 }}>
Admin Assistant is typing...
Admin Assistant is typing…
</div>
)}
<div ref={chatEndRef} />
</>
)}
</div>
{/* footer input — always shown in chat view */}
<div className="chatbot-footer" style={{ padding: '12px', borderTop: '1px solid var(--border)', background: 'var(--bg)' }}>
{view === 'chat' ? (
<form onSubmit={handleSendMessage} style={{ display: 'flex', gap: '8px' }}>
<input
type="text"
<input
type="text"
value={inputText}
onChange={(e) => setInputText(e.target.value)}
placeholder="Ask a question..."
onChange={e => setInputText(e.target.value)}
placeholder="Ask a question…"
style={{ flex: 1, padding: '8px 12px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', background: 'var(--card)', color: 'var(--navy)' }}
/>
<button type="submit" style={{ background: 'var(--blue)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 16px', cursor: 'pointer' }}>
<button type="submit" style={{ background: 'var(--emerald)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 16px', cursor: 'pointer' }}>
Send
</button>
</form>
) : (
<p style={{ margin: 0 }}>Admin tools & shortcuts</p>
<p style={{ margin: 0, fontSize: '13px', color: 'var(--muted)' }}>Admin tools &amp; shortcuts</p>
)}
</div>
</div>
+50 -13
View File
@@ -48,6 +48,7 @@ export default function Chatbot() {
const [view, setView] = useState('menu'); // menu, category, chat
const [activeCategory, setActiveCategory] = useState(null);
const [inputText, setInputText] = useState("");
const [menuInput, setMenuInput] = useState(""); // free-text from menu
const [isTyping, setIsTyping] = useState(false);
const chatEndRef = useRef(null);
@@ -113,30 +114,51 @@ export default function Chatbot() {
setIsTyping(true);
try {
// Convert messages to format expected by backend
const backendMessages = currentMessages.map(m => ({
role: m.role || (m.type === 'bot' ? 'assistant' : 'user'),
content: m.text,
reasoning_details: m.reasoning_details || null
reasoning_details: null,
}));
const res = await authFetch('/api/chatbot/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ messages: backendMessages })
body: JSON.stringify({ messages: backendMessages }),
});
if (res.ok) {
const data = await res.json();
// Extract content and optional reasoning details
const contentText = data.content || "Sorry, I couldn't understand that.";
const reasoning = data.reasoning_details;
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: contentText, reasoning_details: reasoning }]);
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: data.content || "Sorry, I couldn't understand that." }]);
} else {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Sorry, I am having trouble connecting to the server.' }]);
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Having trouble connecting. Please try again.' }]);
}
} catch (err) {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error occurred. Please try again.' }]);
} catch {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error. Please try again.' }]);
} finally {
setIsTyping(false);
}
};
const handleMenuAsk = async (e) => {
e.preventDefault();
if (!menuInput.trim()) return;
const userMessage = { type: 'user', role: 'user', text: menuInput.trim() };
setMessages([userMessage]);
setMenuInput("");
setView('chat');
setIsTyping(true);
try {
const res = await authFetch('/api/chatbot/ask', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ messages: [{ role: 'user', content: userMessage.text, reasoning_details: null }] }),
});
if (res.ok) {
const data = await res.json();
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: data.content || "Sorry, I couldn't understand that." }]);
} else {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Having trouble connecting. Please try again.' }]);
}
} catch {
setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error. Please try again.' }]);
} finally {
setIsTyping(false);
}
@@ -171,6 +193,21 @@ export default function Chatbot() {
<span className="material-symbols-outlined sparkle">auto_awesome</span>
<p>How can we help you today?</p>
</div>
{/* free-text ask from menu */}
<form onSubmit={handleMenuAsk} style={{ marginBottom: '12px', display: 'flex', gap: '6px' }}>
<input
type="text"
value={menuInput}
onChange={e => setMenuInput(e.target.value)}
placeholder="Ask anything…"
style={{ flex: 1, padding: '8px 12px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', background: 'var(--card)', color: 'var(--navy)', fontSize: '13px' }}
/>
<button type="submit" style={{ background: 'var(--emerald)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 14px', cursor: 'pointer', fontSize: '13px' }}>
Ask
</button>
</form>
{user && (
<button className="quick-reply-btn" style={{display: 'flex', width: '100%', marginBottom: '8px'}} onClick={handleDocStatusCheck}>
<span className="qr-icon">📋</span>
@@ -227,7 +264,7 @@ export default function Chatbot() {
placeholder="Ask a question..."
style={{ flex: 1, padding: '8px 12px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', background: 'var(--card)', color: 'var(--navy)' }}
/>
<button type="submit" style={{ background: 'var(--navy)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 16px', cursor: 'pointer' }}>
<button type="submit" style={{ background: 'var(--emerald)', color: '#fff', border: 'none', borderRadius: 'var(--radius-pill)', padding: '8px 16px', cursor: 'pointer' }}>
Send
</button>
</form>
@@ -0,0 +1,63 @@
import { useState } from 'react';
import ExpandableValue from './ExpandableValue';
export default function ExpandableSummaryBlock({ extractedData }) {
const [expanded, setExpanded] = useState(false);
const entries = Object.entries(extractedData);
if (entries.length === 0) {
return (
<div style={{ fontSize: '12px', color: 'var(--muted)', fontStyle: 'italic' }}>
Blank form / No user data found.
</div>
);
}
const showToggle = entries.length > 3;
const entriesToShow = expanded ? entries : entries.slice(0, 3);
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
{entriesToShow.map(([key, value]) => (
<div key={key}>
{/* Field label — uppercase, bold, navy */}
<div style={{
fontSize: '11px',
color: 'var(--navy)',
fontWeight: 700,
textTransform: 'uppercase',
letterSpacing: '0.6px',
marginBottom: '2px',
}}>
{key}
</div>
{/* Field value — bold navy */}
<div style={{ fontSize: '13px', fontWeight: 600, color: 'var(--navy)' }}>
<ExpandableValue value={value} isArray={Array.isArray(value)} />
</div>
</div>
))}
{showToggle && (
<button
type="button"
onClick={() => setExpanded(!expanded)}
style={{
background: 'var(--paper)',
border: '1px solid var(--border)',
color: 'var(--emerald)',
fontSize: '12px',
fontWeight: 600,
padding: '5px 12px',
borderRadius: 'var(--radius-sm)',
cursor: 'pointer',
alignSelf: 'flex-start',
marginTop: '4px',
}}
>
{expanded ? '− Show Less' : `+ Show ${entries.length - 3} More Fields`}
</button>
)}
</div>
);
}
@@ -0,0 +1,75 @@
import { useState } from 'react';
export default function ExpandableValue({ value, isArray }) {
const [expanded, setExpanded] = useState(false);
if (isArray) {
if (!value || value.length === 0) return <span>—</span>;
const showToggle = value.length > 3;
const itemsToShow = expanded ? value : value.slice(0, 3);
return (
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
<ul style={{ margin: '4px 0 0 16px', padding: 0, fontWeight: 600, color: 'var(--navy)' }}>
{itemsToShow.map((item, idx) => (
<li key={idx} style={{ marginBottom: '4px', lineHeight: '1.4' }}>{item}</li>
))}
</ul>
{showToggle && (
<button
type="button"
onClick={() => setExpanded(!expanded)}
style={{
background: 'none',
border: 'none',
color: 'var(--primary)',
fontSize: '12px',
fontWeight: 600,
padding: '4px 0',
marginTop: '4px',
cursor: 'pointer',
display: 'inline-flex',
alignSelf: 'flex-start',
gap: '4px'
}}
>
{expanded ? 'Show Less' : `+ ${value.length - 3} More`}
</button>
)}
</div>
);
}
const text = value !== null && value !== undefined ? String(value) : "—";
const maxLength = 400;
const isLong = text.length > maxLength;
if (!isLong) {
return <span style={{ color: 'var(--navy)', fontWeight: 600, lineHeight: '1.4', display: 'block', marginTop: '2px' }}>{text}</span>;
}
return (
<div style={{ display: 'flex', flexDirection: 'column', marginTop: '2px', width: '100%' }}>
<span style={{ color: 'var(--navy)', fontWeight: 600, lineHeight: '1.4' }}>
{expanded ? text : `${text.slice(0, maxLength)}...`}
</span>
<button
type="button"
onClick={() => setExpanded(!expanded)}
style={{
background: 'none',
border: 'none',
color: 'var(--primary)',
fontSize: '12px',
fontWeight: 600,
padding: '4px 0',
cursor: 'pointer',
marginTop: '2px'
}}
>
{expanded ? 'Read Less' : 'Read More'}
</button>
</div>
);
}
+8 -8
View File
@@ -5,12 +5,12 @@ export default function Footer() {
<footer className="footer">
<div className="footer-top">
<div className="footer-left">
<img src="/images/bookkeeppro-logo.webp" className="footer-logo" alt="Bookkeepro" />
<p>Your Globally Trusted Bookkeeping Partner.</p>
<img src="/images/bookkeeppro-logo.webp" className="footer-logo" alt="BookKeepPro" />
<p>Bookkeeping, payroll and tax preparation for growing businesses — kept precise, kept compliant.</p>
</div>
<div className="footer-links">
<h4>Quick Links</h4>
<h4>Navigate</h4>
<Link to="/">Home</Link>
<Link to="/about-us">About Us</Link>
<Link to="/services">Services</Link>
@@ -18,11 +18,11 @@ export default function Footer() {
</div>
<div className="footer-contact">
<h4>Contact</h4>
<p>📍 USA: McKinney, TX</p>
<p>📍 India: Pune, Maharashtra</p>
<p>📧 vedant.aiindia@gmail.com</p>
<p>📞 +918275367267</p>
<h4>Reach us</h4>
<p>USA · 2520 Indigo Dr, McKinney, TX 75072</p>
<p>India · 508 White Square, Hinjewadi Road, Pune 411057</p>
<p>atharvg.aiindia@gmail.com</p>
<p>+91 8275367267</p>
</div>
</div>
+13 -14
View File
@@ -1,32 +1,32 @@
import { Link, useNavigate } from 'react-router-dom';
import { useState, useEffect } from 'react';
import { useState } from 'react';
import { useTheme } from '../context/ThemeContext';
export default function Navbar({ transparent = false }) {
export default function Navbar({ solid = false }) {
const [isOpen, setIsOpen] = useState(false);
const navigate = useNavigate();
const { theme, toggleTheme } = useTheme();
return (
<div className={`navbar ${transparent ? 'navbar-transparent' : ''}`}>
<div className={`navbar ${solid ? 'navbar-solid' : ''}`}>
<div className="nav-container">
<Link to="/">
<img id="logos" src="/images/bookkeeppro-logo.webp" alt="Bookkeeping Logo" />
<img id="logos" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" />
</Link>
<nav id="navMenu" className={`nav-menu ${isOpen ? 'active' : ''}`}>
<Link to="/">Home</Link>
<Link to="/about-us">About Us</Link>
<Link to="/services">Services</Link>
<Link to="/contact">Contact Us</Link>
<Link to="/" onClick={() => setIsOpen(false)}>Home</Link>
<Link to="/about-us" onClick={() => setIsOpen(false)}>About Us</Link>
<Link to="/services" onClick={() => setIsOpen(false)}>Services</Link>
<Link to="/contact" onClick={() => setIsOpen(false)}>Contact Us</Link>
<button
className="theme-toggle"
onClick={toggleTheme}
style={{background:'none', border:'none', color:'inherit', cursor:'pointer', display:'flex', alignItems:'center', justifyContent:'center', padding:'8px'}}
<button
className="theme-toggle"
onClick={toggleTheme}
style={{ background: 'none', border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '8px' }}
aria-label="Toggle Theme"
>
<span className="material-symbols-outlined theme-toggle-icon" style={{fontSize: '24px'}}>
<span className="material-symbols-outlined" style={{ fontSize: '22px' }}>
{theme === 'dark' ? 'light_mode' : 'dark_mode'}
</span>
</button>
@@ -34,7 +34,6 @@ export default function Navbar({ transparent = false }) {
<button className="login-btn desktop-login" onClick={() => navigate('/login')}>
Sign in
</button>
<button className="login-btn mobile-login" onClick={() => navigate('/login')}>
Sign in
</button>
+14 -14
View File
@@ -1,4 +1,4 @@
import { createContext, useContext, useState, useEffect } from 'react';
import { createContext, useContext, useState, useEffect, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
const AuthContext = createContext();
@@ -9,18 +9,7 @@ export function AuthProvider({ children }) {
const [loading, setLoading] = useState(true);
const navigate = useNavigate();
useEffect(() => {
if (token) {
localStorage.setItem('token', token);
fetchUser();
} else {
localStorage.removeItem('token');
setUser(null);
setLoading(false);
}
}, [token]);
const fetchUser = async () => {
const fetchUser = useCallback(async () => {
try {
const res = await fetch('/api/auth/me', {
headers: {
@@ -39,7 +28,18 @@ export function AuthProvider({ children }) {
} finally {
setLoading(false);
}
};
}, [token]);
useEffect(() => {
if (token) {
localStorage.setItem('token', token);
fetchUser();
} else {
localStorage.removeItem('token');
setUser(null);
setLoading(false);
}
}, [token, fetchUser]);
const login = (newToken) => {
setLoading(true);
+1 -1
View File
@@ -21,7 +21,7 @@ export function ToastProvider({ children }) {
}, []);
return (
<ToastContext.Provider value={{ addToast }}>
<ToastContext.Provider value={{ addToast, showToast: addToast }}>
{children}
<div className="toast-container">
{toasts.map(toast => (
+300 -2676
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -10,7 +10,7 @@ export default function DashboardLayout() {
return (
<div className="app-body">
<header className="app-header">
<Link to="/dashboard">
<Link to={(user?.role === 'admin' || user?.role === 'super_admin') ? '/admin-dashboard' : '/dashboard'}>
<img className="logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" />
</Link>
<div className="header-actions">
+3
View File
@@ -2,9 +2,12 @@ import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
import { initScrollReveal } from './utils/scrollReveal.js'
createRoot(document.getElementById('root')).render(
<StrictMode>
<App />
</StrictMode>,
)
initScrollReveal()
+40 -41
View File
@@ -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>
</>
);
}
+42 -27
View File
@@ -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>
+159 -60
View File
@@ -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>
))}
+67 -88
View File
@@ -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
View File
@@ -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>
</>
);
}
+33 -42
View File
@@ -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>
</>
+65 -27
View File
@@ -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>
+65 -27
View File
@@ -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>
+37 -38
View File
@@ -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>
);
}
}
+36
View File
@@ -0,0 +1,36 @@
// Lightweight scroll-reveal: watches for elements with the `.reveal` class
// (added throughout the marketing pages) and adds `.in-view` once they enter
// the viewport. Re-scans on DOM mutation so it keeps working across route
// changes in the SPA without needing per-page wiring.
let observer;
function ensureObserver() {
if (observer) return observer;
observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('in-view');
observer.unobserve(entry.target);
}
});
},
{ threshold: 0.15, rootMargin: '0px 0px -40px 0px' }
);
return observer;
}
function scan() {
const obs = ensureObserver();
document.querySelectorAll('.reveal:not(.in-view)').forEach((el) => obs.observe(el));
}
export function initScrollReveal() {
if (typeof window === 'undefined') return;
scan();
const mo = new MutationObserver(() => scan());
mo.observe(document.getElementById('root') || document.body, {
childList: true,
subtree: true,
});
}