Nenhuma candidatura recente.
+
- {application.jobTitle || "Vaga desconhecida"}
+ {application.jobTitle || t('company.dashboard.recent_applications.unknown_job')}
{formatDistanceToNow(new Date(application.created_at), { addSuffix: true, locale: ptBR })}
diff --git a/frontend/src/components/sidebar.tsx b/frontend/src/components/sidebar.tsx
index 2612e09..96f8b28 100644
--- a/frontend/src/components/sidebar.tsx
+++ b/frontend/src/components/sidebar.tsx
@@ -6,99 +6,110 @@ import { usePathname } from "next/navigation"
import { cn } from "@/lib/utils"
import { LayoutDashboard, Briefcase, Users, MessageSquare, Building2, FileText, HelpCircle, Ticket } from "lucide-react"
import { getCurrentUser, isAdminUser } from "@/lib/auth"
+import { useTranslation } from "@/lib/i18n"
-const adminItems = [
- {
- title: "Dashboard",
- href: "/dashboard",
- icon: LayoutDashboard,
- },
- {
- title: "Jobs",
- href: "/dashboard/jobs",
- icon: Briefcase,
- },
- {
- title: "Candidates",
- href: "/dashboard/candidates",
- icon: Users,
- },
- {
- title: "Users",
- href: "/dashboard/users",
- icon: Users,
- },
- {
- title: "Companies",
- href: "/dashboard/companies",
- icon: Building2,
- },
- {
- title: "Backoffice",
- href: "/dashboard/backoffice",
- icon: FileText,
- },
- {
- title: "Messages",
- href: "/dashboard/messages",
- icon: MessageSquare,
- },
- {
- title: "Tickets",
- href: "/dashboard/tickets",
- icon: Ticket,
- },
-]
-
-const companyItems = [
- {
- title: "Dashboard",
- href: "/dashboard",
- icon: LayoutDashboard,
- },
- {
- title: "My jobs",
- href: "/dashboard/my-jobs",
- icon: Briefcase,
- },
- {
- title: "Applications",
- href: "/dashboard/applications",
- icon: Users,
- },
-]
-
-const candidateItems = [
- {
- title: "Dashboard",
- href: "/dashboard",
- icon: LayoutDashboard,
- },
- {
- title: "Jobs",
- href: "/jobs", // Public search
- icon: Briefcase,
- },
- {
- title: "My applications",
- href: "/dashboard/my-applications",
- icon: FileText,
- },
- {
- title: "Support",
- href: "/dashboard/support/tickets",
- icon: HelpCircle,
- },
-]
-
-export function Sidebar() {
+const Sidebar = () => {
+ const { t } = useTranslation()
const pathname = usePathname()
const user = getCurrentUser()
const isSuperadmin = user?.role === "superadmin"
+ const adminItems = [
+ {
+ title: t('sidebar.dashboard'),
+ href: "/dashboard",
+ icon: LayoutDashboard,
+ },
+ {
+ title: t('sidebar.jobs'),
+ href: "/dashboard/jobs",
+ icon: Briefcase,
+ },
+ {
+ title: t('sidebar.candidates'),
+ href: "/dashboard/candidates",
+ icon: Users,
+ },
+ {
+ title: t('sidebar.users'),
+ href: "/dashboard/users",
+ icon: Users,
+ },
+ {
+ title: t('sidebar.companies'),
+ href: "/dashboard/companies",
+ icon: Building2,
+ },
+ {
+ title: t('sidebar.backoffice'),
+ href: "/dashboard/backoffice",
+ icon: FileText,
+ },
+ {
+ title: t('sidebar.messages'),
+ href: "/dashboard/messages",
+ icon: MessageSquare,
+ },
+ {
+ title: t('sidebar.tickets'),
+ href: "/dashboard/tickets",
+ icon: Ticket,
+ },
+ ]
+
+ const companyItems = [
+ {
+ title: t('sidebar.dashboard'),
+ href: "/dashboard",
+ icon: LayoutDashboard,
+ },
+ {
+ title: t('sidebar.my_jobs'),
+ href: "/dashboard/my-jobs",
+ icon: Briefcase,
+ },
+ {
+ title: t('sidebar.applications'),
+ href: "/dashboard/applications",
+ icon: Users,
+ },
+ {
+ title: t('sidebar.messages'),
+ href: "/dashboard/messages",
+ icon: MessageSquare,
+ },
+ {
+ title: t('sidebar.support'),
+ href: "/dashboard/support",
+ icon: HelpCircle,
+ },
+ ]
+
+ const candidateItems = [
+ {
+ title: t('sidebar.dashboard'),
+ href: "/dashboard",
+ icon: LayoutDashboard,
+ },
+ {
+ title: t('sidebar.jobs'),
+ href: "/jobs",
+ icon: Briefcase,
+ },
+ {
+ title: t('sidebar.my_applications'),
+ href: "/dashboard/my-applications",
+ icon: FileText,
+ },
+ {
+ title: t('sidebar.support'),
+ href: "/dashboard/support/tickets",
+ icon: HelpCircle,
+ },
+ ]
+
let items = candidateItems
if (isAdminUser(user)) {
- // For Admin (not Superadmin), filter out Backoffice
items = isSuperadmin
? adminItems
: adminItems.filter(item => item.href !== "/dashboard/backoffice" && item.href !== "/dashboard/companies")
@@ -108,7 +119,6 @@ export function Sidebar() {
return (