new updates & survey quater dropdown values updated
This commit is contained in:
parent
c5a8cb33f4
commit
74174618db
@ -140,11 +140,11 @@ const SubmissionTable = ({ selectedQuarter, selectedYear }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="space-y-[1px] overflow-x-auto">
|
<div className="space-y-[1px] overflow-x-auto">
|
||||||
<div className="px-6 pt-6 pb-4">
|
{/* <div className="px-6 pt-6 pb-4">
|
||||||
<h2 className="text-[18px] leading-[28px] font-medium text-[#232528]">
|
<h2 className="text-[18px] leading-[28px] font-medium text-[#232528]">
|
||||||
{titleText}
|
{titleText}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="flex items-center justify-center h-[500px] text-gray-500">
|
<div className="flex items-center justify-center h-[500px] text-gray-500">
|
||||||
|
|||||||
@ -29,9 +29,11 @@ const AdminDashboard = () => {
|
|||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await apiClient.get('/admin_dashboard');
|
const response = await apiClient.get('/admin_dashboard');
|
||||||
|
|
||||||
const data = response?.data?.summary || {};
|
const data = response?.data?.summary || {};
|
||||||
// const notStartedCombined = (data.not_started || 0) + (data.overdue || 0);
|
const selectedQuarterFromApi = response?.data?.selected_quarter || 'All';
|
||||||
|
const selectedYearFromApi = response?.data?.selected_year || 'All';
|
||||||
|
|
||||||
setSummary({
|
setSummary({
|
||||||
total_establishments: data.total_establishments || 0,
|
total_establishments: data.total_establishments || 0,
|
||||||
submitted: data.submitted || 0,
|
submitted: data.submitted || 0,
|
||||||
@ -40,15 +42,18 @@ const AdminDashboard = () => {
|
|||||||
not_started: data.not_started || 0,
|
not_started: data.not_started || 0,
|
||||||
pending: data.pending || 0,
|
pending: data.pending || 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setSelectedQuarter(selectedQuarterFromApi);
|
||||||
|
setSelectedYear(selectedYearFromApi);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching dashboard summary:', error);
|
console.error('Error fetching dashboard summary:', error);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchDashboardData();
|
fetchDashboardData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-[#F6F5F1]">
|
<div className="min-h-screen bg-[#F6F5F1]">
|
||||||
@ -70,7 +75,7 @@ const AdminDashboard = () => {
|
|||||||
onChange={(e) => setSelectedQuarter(e.target.value)}
|
onChange={(e) => setSelectedQuarter(e.target.value)}
|
||||||
className="border border-[#D0D5DD] rounded-md h-8 px-2 text-sm focus:outline-none focus:ring-1 focus:ring-[#92722A]"
|
className="border border-[#D0D5DD] rounded-md h-8 px-2 text-sm focus:outline-none focus:ring-1 focus:ring-[#92722A]"
|
||||||
>
|
>
|
||||||
<option>All</option>
|
{/* <option>All</option> */}
|
||||||
<option>Q1</option>
|
<option>Q1</option>
|
||||||
<option>Q2</option>
|
<option>Q2</option>
|
||||||
<option>Q3</option>
|
<option>Q3</option>
|
||||||
@ -82,7 +87,7 @@ const AdminDashboard = () => {
|
|||||||
onChange={(e) => setSelectedYear(e.target.value)}
|
onChange={(e) => setSelectedYear(e.target.value)}
|
||||||
className="border border-[#D0D5DD] rounded-md h-8 px-2 text-sm focus:outline-none focus:ring-1 focus:ring-[#92722A]"
|
className="border border-[#D0D5DD] rounded-md h-8 px-2 text-sm focus:outline-none focus:ring-1 focus:ring-[#92722A]"
|
||||||
>
|
>
|
||||||
<option>All</option>
|
{/* <option>All</option> */}
|
||||||
<option>2025</option>
|
<option>2025</option>
|
||||||
<option>2024</option>
|
<option>2024</option>
|
||||||
<option>2023</option>
|
<option>2023</option>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user