mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 09:32:08 +01:00
feat: implement comprehensive enum formatting system
- Create centralized enum formatting utility for database enums - Transform raw enums to human-readable text (SALARY_COMPENSATION → Salary & Compensation) - Apply formatting across sessions list, individual session pages, and charts - Improve color contrast ratios for better WCAG compliance - Add semantic list structure with proper article elements - Enhance accessibility with proper ARIA labels and screen reader support - Fix all instances where users saw ugly database enums in UI
This commit is contained in:
@ -7,6 +7,7 @@ import SessionDetails from "../../../../components/SessionDetails";
|
||||
import TranscriptViewer from "../../../../components/TranscriptViewer";
|
||||
import MessageViewer from "../../../../components/MessageViewer";
|
||||
import { ChatSession } from "../../../../lib/types";
|
||||
import { formatCategory } from "@/lib/format-enums";
|
||||
import Link from "next/link";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@ -181,10 +182,10 @@ export default function SessionViewPage() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{session.category && session.category !== 'UNRECOGNIZED_OTHER' && session.category !== 'ACCESS_LOGIN' && (
|
||||
{session.category && (
|
||||
<Badge variant="secondary" className="gap-1">
|
||||
<Activity className="h-3 w-3" />
|
||||
{session.category.replace(/_/g, ' ').toLowerCase().replace(/\b\w/g, l => l.toUpperCase())}
|
||||
{formatCategory(session.category)}
|
||||
</Badge>
|
||||
)}
|
||||
{session.language && (
|
||||
|
||||
Reference in New Issue
Block a user