import { useState, useEffect } from 'react';
import {
BookOpen,
PiggyBank,
Users,
TrendingUp,
Mic,
Volume2,
ChevronRight,
IndianRupee,
Target,
History
} from 'lucide-react';
export default function App() {
const [language, setLanguage] = useState('en');
const [balance, setBalance] = useState(5000);
const [savingsGoal, setSavingsGoal] = useState(10000);
const [transactions, setTransactions] = useState([]);
const [isListening, setIsListening] = useState(false);
const translations = {
en: {
title: 'Financial Empowerment',
balance: 'Current Balance',
goal: 'Savings Goal',
learn: 'Learn',
budget: 'Budget',
community: 'Community',
invest: 'Invest',
progress: 'Progress',
recentActivity: 'Recent Activity'
},
hi: {
title: 'वित्तीय सशक्तिकरण',
balance: 'वर्तमान बैलेंस',
goal: 'बचत लक्ष्य',
learn: 'सीखें',
budget: 'बजट',
community: 'समुदाय',
invest: 'निवेश',
progress: 'प्रगति',
recentActivity: 'हाल की गतिविधि'
}
};
const t = translations[language];
useEffect(() => {
// Fetch initial data from API
const fetchData = async () => {
try {
const response = await fetch(`https://www.sitebrew.ai/api/z4CIhv/transactions`);
const data = await response.json();
setTransactions(data.document || []);
} catch (error) {
console.error('Error fetching data:', error);
}
};
fetchData();
}, []);
const toggleVoiceAssistant = () => {
setIsListening(!isListening);
// Voice assistant implementation would go here
};
return (
{/* Header */}
{/* Main Content */}
{/* Quick Actions */}
{[
{ icon:
, label: t.learn },
{ icon:
, label: t.budget },
{ icon:
, label: t.community },
{ icon:
, label: t.invest }
].map((action, index) => (
))}
{/* Savings Progress */}
{t.goal}
₹{balance.toLocaleString()} / ₹{savingsGoal.toLocaleString()}
{/* Recent Activity */}
{t.recentActivity}
{transactions.map((transaction, index) => (
{transaction.description}
{transaction.date}
{transaction.type === 'credit' ? '+' : '-'}₹{transaction.amount}
))}
);
}