/dashboard/employee. These components handle user interactions, display data, and manage the dashboard experience.
Component organization
Dashboard components are located incomponents/dashboard/employee/ with this structure:
Core components
Sidebar navigation
The main navigation sidebar with collapsible functionality.dashboard/employee/sidebarNav.tsx
Features
- Collapsible icon-only mode
- Active route highlighting
- User profile dropdown with avatar
- Profile progress indicator
- Navigation tooltips
- Logout functionality integrated with Better Auth
Data structure
lib/data/nav-data.ts.
Sidebar state
The sidebar uses theuseSidebar() hook from components/animate-ui:
Profile dropdown
The user profile dropdown includes:Sidebar shell
Wrapper component providing the sidebar layout structure.dashboard/employee/sidebarshell.tsx
Content components
Home content
The main dashboard home view with metrics and recommendations.dashboard/employee/homeContent.tsx
Features
- Personalized greeting with user’s first name
- Notification bell with unread count
- Metric cards grid (applications, views, interviews)
- Recent applications widget
- Recent messages widget
- Recommended jobs section with cards
- Job alerts configuration
Data flow
Event handlers
Common event handlers follow thehandle prefix pattern:
Search content
Job search interface with filters and results.dashboard/employee/searchContent.tsx
Saved content
Saved jobs management view.dashboard/employee/savedContent.tsx
Applications content
Job applications tracking and management.dashboard/employee/applicationsContent.tsx
Messages content
Messaging interface for employer communications.dashboard/employee/messagesContent.tsx
Metrics content
User analytics and insights dashboard.dashboard/employee/metricsContent.tsx
Home sub-components
Home header
Dashboard header with greeting and notifications.dashboard/employee/home/homeHeader.tsx
Metric card
Displays individual metrics with trend indicators.dashboard/employee/home/metricCard.tsx
Features
- Icon display with consistent sizing
- Large value display
- Optional trend indicator with color coding
- Optional subtitle for additional context
- Memoized for performance
Recommended job card
Job recommendation card with quick actions.dashboard/employee/home/recommendedJobCard.tsx
Recent applications card
Widget showing recent job applications.dashboard/employee/home/recentApplicationsCard.tsx
Recent messages card
Widget displaying recent messages from employers.dashboard/employee/home/recentMessagesCard.tsx
Job alerts card
Configuration widget for job alerts.dashboard/employee/home/jobAlertsCard.tsx
Calendar components
Calendar
Main calendar component for interview scheduling.dashboard/employee/calendar/calendar.tsx
Calendar section
Wrapper component for calendar integration.dashboard/employee/calendar/calendar-section.tsx
Day modal
Modal displaying day details and events.dashboard/employee/calendar/day-modal.tsx
Event tooltip
Tooltip showing event details on hover.dashboard/employee/calendar/event-tooltip.tsx
Upcoming events
List of upcoming calendar events.dashboard/employee/calendar/upcoming-events.tsx
Component patterns
Authentication integration
All dashboard components integrate with Better Auth:Router navigation
Use Next.js router for navigation:State management
Use React hooks for local state:Slug generation
Convert titles to URL-friendly slugs:Memoization
Optimize performance with memo:Data types
Common TypeScript interfaces fromlib/types/dashboard.ts:
Styling patterns
Dashboard components follow these conventions:- Grid layouts: Responsive grids with
grid-cols-1 md:grid-cols-2 lg:grid-cols-3 - Card spacing: Consistent
gap-4between cards - Content padding:
p-4for main content areas - Header spacing:
mt-4for section headers - Text hierarchy:
text-xlfor section titles,text-smfor metadata - Interactive states: Hover effects with
hover:bg-accenttransitions
Accessibility
Dashboard components include:- Proper ARIA labels for interactive elements
- Keyboard navigation support
- Focus indicators on all interactive elements
- Screen reader friendly notifications
- Semantic HTML structure
- Loading states with
isPendingchecks