import { useState } from 'react';
import {
Users,
Home,
BarChart2,
Settings,
Search,
Globe,
LogOut,
ChevronDown,
Plus,
Save,
X,
Camera
} from 'lucide-react';
// Add new CensusForm component
function CensusForm({ onClose }) {
const [formData, setFormData] = useState({
householdId: '',
zone: '',
kebele: '',
houseNumber: '',
gpsLocation: '',
householdHead: {
firstName: '',
lastName: '',
gender: '',
dateOfBirth: '',
nationalId: '',
phoneNumber: '',
occupation: '',
educationLevel: ''
},
familyMembers: [],
housingInfo: {
ownershipStatus: '',
constructionMaterial: '',
numberOfRooms: '',
waterSource: '',
electricityAccess: '',
toiletType: ''
}
});
const handleSubmit = (e) => {
e.preventDefault();
// Handle form submission
console.log('Form submitted:', formData);
};
return (
);
}
// Update the main dashboard component to include the form
export default function CensusDashboard() {
const [selectedLanguage, setSelectedLanguage] = useState('en');
const [searchQuery, setSearchQuery] = useState('');
const [showForm, setShowForm] = useState(false);
const translations = {
en: {
dashboard: "Dashboard",
search: "Search records...",
totalPopulation: "Total Population",
householdCount: "Household Count",
pendingApprovals: "Pending Approvals",
recentActivity: "Recent Activity",
addNew: "Add New Record",
demographics: "Demographics",
settings: "Settings",
logout: "Logout"
},
am: {
dashboard: "ዳሽቦርድ",
search: "መዝገቦችን ፈልግ...",
totalPopulation: "ጠቅላላ ሕዝብ",
householdCount: "የቤተሰብ ብዛት",
pendingApprovals: "በመጠባበቅ ላይ ያሉ ማጽደቆች",
recentActivity: "የቅርብ ጊዜ እንቅስቃሴ",
addNew: "አዲስ መዝገብ ጨምር",
demographics: "ዲሞግራፊክስ",
settings: "ቅንብሮች",
logout: "ውጣ"
},
or: {
dashboard: "Daashboordii",
search: "Galmee barbaadi...",
totalPopulation: "Ummata Waliigalaa",
householdCount: "Baay'ina Maatii",
pendingApprovals: "Hayyama Eeggataa",
recentActivity: "Gochaalee Dhiyoo",
addNew: "Galmee Haaraa Ida'i",
demographics: "Demograafiksii",
settings: "Qindaa'ina",
logout: "Ba'i"
}
};
const t = translations[selectedLanguage];
return (
{/* Sidebar */}
Bale Robe Census
{/* Main Content */}
{/* Top Bar */}
{/* Stats Cards */}
{t.totalPopulation}
127,842
+2.4% from last month
{t.householdCount}
31,960
+1.8% from last month
{t.pendingApprovals}
284
Requires attention
{/* Recent Activity & Add New Record */}
{t.recentActivity}
{/* Activity Table */}
| ID |
Name |
Location |
Status |
Date |
{[1, 2, 3, 4, 5].map((item) => (
| #{String(item).padStart(4, '0')} |
John Doe |
Bale Robe, Zone 1 |
Approved
|
2024-01-20 |
))}
{/* Census Form Modal */}
{showForm &&
setShowForm(false)} />}
);
}