Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions app-frontend/employer-panel/src/pages/EmployerDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useMemo, useRef, useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import "./EmployerDashboard.css";
import translations from '../i18n/translations';
import Header from '../components/Header';


/* --- icons --- */
const IconCalendar = (props) => (
Expand Down Expand Up @@ -119,11 +121,14 @@ const getShiftStatusCategory = (shift) => {
return "All";
};

export default function EmployerDashboard() {
export default function EmployerDashboard({language}) {
const t = translations[language || "en"] || translations.en; //changes made
const [view, setView] = useState("list");
const reviewScroller = useRef(null);
const navigate = useNavigate();



const [shifts, setShifts] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
Expand Down Expand Up @@ -465,12 +470,13 @@ export default function EmployerDashboard() {

return (
<div className="ss-page">

<main className="ss-main">
<div className="ss-overview-head">
<div>
<h2 className="ss-h1">Overview</h2>
<h2 className="ss-h1">{t.overview}</h2>
<p className="ss-overview-subtitle">
{shifts.length} shifts · last updated just now
{shifts.length} {t.shifts} · last updated just now
</p>
</div>

Expand Down Expand Up @@ -662,7 +668,7 @@ export default function EmployerDashboard() {
</div>

<div className="ss-section-head">
<h2 className="ss-section-title">Incident Reports</h2>
<h2 className="ss-section-title">{t.incidentReports}</h2>
<p className="ss-section-subtitle">
{incidentSummary.pending} pending · {incidentSummary.total} total
</p>
Expand Down Expand Up @@ -766,7 +772,7 @@ export default function EmployerDashboard() {
</div>

<div className="ss-section-head ss-section-head--reviews">
<h2 className="ss-section-title">Recent Reviews</h2>
<h2 className="ss-section-title">{t.recentReviews}</h2> //changes made
<div className="ss-review-arrows">
<button className="ss-mini-arrow" onClick={() => scrollByAmount(reviewScroller, -300)} type="button">
Expand Down Expand Up @@ -911,4 +917,4 @@ export default function EmployerDashboard() {
)}
</div>
);
}
}