feat: Enhance project status handling with additional statuses and translations
This commit is contained in:
@@ -34,15 +34,24 @@ const statusColors = {
|
||||
approved: "bg-green-100 text-green-800",
|
||||
pending: "bg-yellow-100 text-yellow-800",
|
||||
in_progress: "bg-orange-100 text-orange-800",
|
||||
in_progress_design: "bg-purple-100 text-purple-800",
|
||||
in_progress_construction: "bg-indigo-100 text-indigo-800",
|
||||
fulfilled: "bg-gray-100 text-gray-800",
|
||||
cancelled: "bg-red-100 text-red-800",
|
||||
};
|
||||
|
||||
const statusTranslations = {
|
||||
const getStatusTranslation = (status) => {
|
||||
const translations = {
|
||||
registered: "Zarejestrowany",
|
||||
approved: "Zatwierdzony",
|
||||
pending: "Oczekujący",
|
||||
in_progress: "W trakcie",
|
||||
in_progress_design: "W realizacji (projektowanie)",
|
||||
in_progress_construction: "W realizacji (realizacja)",
|
||||
fulfilled: "Zakończony",
|
||||
cancelled: "Wycofany",
|
||||
};
|
||||
return translations[status] || status;
|
||||
};
|
||||
|
||||
export default function ProjectCalendarPage() {
|
||||
@@ -232,8 +241,8 @@ export default function ProjectCalendarPage() {
|
||||
};
|
||||
|
||||
const renderUpcomingView = () => {
|
||||
const upcomingProjects = getUpcomingProjects();
|
||||
const overdueProjects = getOverdueProjects();
|
||||
const upcomingProjects = getUpcomingProjects().filter(project => project.project_status !== 'cancelled');
|
||||
const overdueProjects = getOverdueProjects().filter(project => project.project_status !== 'cancelled');
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -266,7 +275,7 @@ export default function ProjectCalendarPage() {
|
||||
{formatDate(project.finish_date)}
|
||||
</div>
|
||||
<Badge className={statusColors[project.project_status] || statusColors.registered}>
|
||||
{statusTranslations[project.project_status] || project.project_status}
|
||||
{getStatusTranslation(project.project_status) || project.project_status}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -311,7 +320,7 @@ export default function ProjectCalendarPage() {
|
||||
za {daysUntilDeadline} dni
|
||||
</div>
|
||||
<Badge className={statusColors[project.project_status] || statusColors.registered}>
|
||||
{statusTranslations[project.project_status] || project.project_status}
|
||||
{getStatusTranslation(project.project_status) || project.project_status}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user