diff --git a/frontend/src/components/users/EmployeeRequestsProfileSections.tsx b/frontend/src/components/users/EmployeeRequestsProfileSections.tsx index 19dcde97..006ffc81 100644 --- a/frontend/src/components/users/EmployeeRequestsProfileSections.tsx +++ b/frontend/src/components/users/EmployeeRequestsProfileSections.tsx @@ -22,6 +22,7 @@ import { type LucideIcon, } from "lucide-react"; +import { Modal } from "@/components/ui/Modal"; import { ProjectSelectMenu } from "@/components/ui/ProjectSelectMenu"; import { apiClient } from "@/lib/api"; import { ApiError } from "@/lib/api/client"; @@ -295,7 +296,7 @@ function StatisticsGrid({ statistics }: { statistics: RequestEmployeeStatistics export default function EmployeeRequestsProfileSections({ employeeId }: { employeeId: number }) { const [requestsOpen, setRequestsOpen] = useState(false); - const [statisticsOpen, setStatisticsOpen] = useState(false); + const [statisticsModalOpen, setStatisticsModalOpen] = useState(false); const [data, setData] = useState(null); const [loading, setLoading] = useState(true); const [requestsLoading, setRequestsLoading] = useState(false); @@ -358,30 +359,47 @@ export default function EmployeeRequestsProfileSections({ employeeId }: { employ } - action={badge} + action={ +
+ {badge} + +
+ } open={requestsOpen} onToggle={() => setRequestsOpen((value) => !value)} > - {content || { - setError(null); - setRequestsLoading(true); - setRequestPage(nextPage); - }} - />} + {content || ( + { + setError(null); + setRequestsLoading(true); + setRequestPage(nextPage); + }} + /> + )}
- setStatisticsModalOpen(false)} title="Статистика по заявлениям" - icon={} - action={ - loading ? ( - - ) : data ? ( + size="md" + closeOnClickOutside + > +
+ {data ? ( - ) : null - } - open={statisticsOpen} - onToggle={() => setStatisticsOpen((value) => !value)} - > - {content || (statisticsLoading ? ( + ) : null} +
+ {error ? ( +
{error}
+ ) : loading || !data ? ( +
+ + Загрузка статистики... +
+ ) : statisticsLoading ? (
Обновляем статистику...
- ) : data ? : null)} -
+ ) : ( + + )} + ); }