import { createFileRoute, redirect } from '@tanstack/react-router'; import { DashboardPage } from '@/features/dashboard/DashboardPage'; import { EmployeeRole } from '@archer/domain'; import { authenticatedUserStore } from '@/infrastructure/storage/AuthenticatedUserStore'; export const Route = createFileRoute('/_authenticated/dashboard/')({ beforeLoad: () => { const user = authenticatedUserStore.get(); if (user?.role === EmployeeRole.OPERATOR) { throw redirect({ to: '/dashboard/conversations' }); } }, component: DashboardPage, });