-
-
-
- Showing page {page}
- {pages && of {pages}}
+
+ Showing page {page}
+ {pages && of {pages}}
{total && ({total} total tickets)}
diff --git a/apps/web/features/tickets/components/TicketPriorityBadge.tsx b/apps/web/features/tickets/components/TicketPriorityBadge.tsx
index fef4343..7c2c945 100644
--- a/apps/web/features/tickets/components/TicketPriorityBadge.tsx
+++ b/apps/web/features/tickets/components/TicketPriorityBadge.tsx
@@ -1,4 +1,5 @@
import { TicketPriority } from '../types';
+import { Badge } from '@/components/ui/badge';
interface Props {
priority: TicketPriority;
@@ -6,26 +7,24 @@ interface Props {
}
export function TicketPriorityBadge({ priority, className = '' }: Props) {
- const getStyles = () => {
+ const getVariant = () => {
switch (priority) {
case TicketPriority.LOW:
- return 'bg-gray-100 text-gray-800 border-gray-200';
+ return 'secondary';
case TicketPriority.MEDIUM:
- return 'bg-blue-100 text-blue-800 border-blue-200';
+ return 'default';
case TicketPriority.HIGH:
- return 'bg-orange-100 text-orange-800 border-orange-200';
+ return 'default';
case TicketPriority.URGENT:
- return 'bg-red-100 text-red-800 border-red-200';
+ return 'destructive';
default:
- return 'bg-gray-100 text-gray-800 border-gray-200';
+ return 'outline';
}
};
return (
-
+
{priority}
-
+
);
}
diff --git a/apps/web/features/tickets/components/TicketStatusBadge.tsx b/apps/web/features/tickets/components/TicketStatusBadge.tsx
index 2bb0ce1..b18a70b 100644
--- a/apps/web/features/tickets/components/TicketStatusBadge.tsx
+++ b/apps/web/features/tickets/components/TicketStatusBadge.tsx
@@ -1,4 +1,5 @@
import { TicketStatus } from '../types';
+import { Badge } from '@/components/ui/badge';
interface Props {
status: TicketStatus;
@@ -6,20 +7,20 @@ interface Props {
}
export function TicketStatusBadge({ status, className = '' }: Props) {
- const getStyles = () => {
+ const getVariant = () => {
switch (status) {
case TicketStatus.OPEN:
- return 'bg-blue-100 text-blue-800 border-blue-200';
+ return 'default';
case TicketStatus.IN_PROGRESS:
- return 'bg-yellow-100 text-yellow-800 border-yellow-200';
+ return 'secondary';
case TicketStatus.PENDING:
- return 'bg-orange-100 text-orange-800 border-orange-200';
+ return 'secondary';
case TicketStatus.RESOLVED:
- return 'bg-green-100 text-green-800 border-green-200';
+ return 'default';
case TicketStatus.CLOSED:
- return 'bg-gray-100 text-gray-800 border-gray-200';
+ return 'outline';
default:
- return 'bg-gray-100 text-gray-800 border-gray-200';
+ return 'outline';
}
};
@@ -28,10 +29,8 @@ export function TicketStatusBadge({ status, className = '' }: Props) {
};
return (
-
+
{getLabel()}
-
+
);
}
diff --git a/apps/web/features/tickets/components/TicketTable.tsx b/apps/web/features/tickets/components/TicketTable.tsx
index dd1469a..fc2c1e6 100644
--- a/apps/web/features/tickets/components/TicketTable.tsx
+++ b/apps/web/features/tickets/components/TicketTable.tsx
@@ -2,6 +2,8 @@ import { Ticket } from '../types';
import { TicketStatusBadge } from './TicketStatusBadge';
import { TicketPriorityBadge } from './TicketPriorityBadge';
import Link from 'next/link';
+import { Card } from '@/components/ui/card';
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
interface Props {
tickets: Ticket[];
@@ -9,65 +11,53 @@ interface Props {
export function TicketTable({ tickets }: Props) {
return (
-
-
-
-
- |
- Title
- |
-
- Status
- |
-
- Priority
- |
-
- Category
- |
-
- Created
- |
-
- Actions
- |
-
-
-
+
+
+
+
+ Title
+ Status
+ Priority
+ Category
+ Created
+ Actions
+
+
+
{tickets.length === 0 ? (
-
- |
+
+
No tickets found.
- |
-
+
+
) : (
tickets.map((ticket) => (
-
- |
+
+
{ticket.title}
- |
-
+
+
- |
-
+
+
- |
-
+
+
{ticket.category || '-'}
- |
-
+
+
{new Date(ticket.created_at).toLocaleDateString()}
- |
-
-
+
+
+
View, {ticket.title}
- |
-
+
+
))
)}
-
-
-
+
+
+
);
}
diff --git a/apps/web/features/tickets/components/TicketWorkflow.tsx b/apps/web/features/tickets/components/TicketWorkflow.tsx
index 06e902b..a0b3c8e 100644
--- a/apps/web/features/tickets/components/TicketWorkflow.tsx
+++ b/apps/web/features/tickets/components/TicketWorkflow.tsx
@@ -4,6 +4,8 @@ import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { ticketService } from '../api/tickets.api';
import { TicketStatus } from '../types';
+import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
+import { Button } from '@/components/ui/button';
interface Props {
ticketId: string;
@@ -47,27 +49,30 @@ export function TicketWorkflow({ ticketId, currentStatus }: Props) {
}
return (
-
-
Workflow Actions
-
- {error && (
-
- {error}
-
- )}
+
+
+ Workflow Actions
+
+
+ {error && (
+
+ {error}
+
+ )}
-
- {availableTransitions.map((status) => (
- handleStatusChange(status)}
- disabled={isUpdating}
- className="rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50 transition-colors"
- >
- Transition to {status.replace('_', ' ')}
-
- ))}
-
-
+
+ {availableTransitions.map((status) => (
+ handleStatusChange(status)}
+ disabled={isUpdating}
+ >
+ Transition to {status.replace('_', ' ')}
+
+ ))}
+
+
+
);
}
diff --git a/apps/web/features/users/components/UserActions.tsx b/apps/web/features/users/components/UserActions.tsx
index 51c67de..7b39af0 100644
--- a/apps/web/features/users/components/UserActions.tsx
+++ b/apps/web/features/users/components/UserActions.tsx
@@ -4,6 +4,8 @@ import React, { useState } from 'react';
import { useRouter } from 'next/navigation';
import { User } from '../types';
import { UserService } from '../api/users.api';
+import { Button } from '@/components/ui/button';
+import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
interface UserActionsProps {
user: User;
@@ -53,36 +55,36 @@ export function UserActions({ user }: UserActionsProps) {
};
return (
-
-
User Actions
+
+
+ User Actions
+
- {error && (
-
- {error}
-
- )}
-
-
-
- {user.is_active ? 'Deactivate User' : 'Activate User'}
-
+
+ {error && (
+
+ {error}
+
+ )}
-
- Delete User
-
-
-
+
+
+ {user.is_active ? 'Deactivate User' : 'Activate User'}
+
+
+
+ Delete User
+
+
+
+
);
}
diff --git a/apps/web/features/users/components/UserFilters.tsx b/apps/web/features/users/components/UserFilters.tsx
index 0f1c91f..812c69c 100644
--- a/apps/web/features/users/components/UserFilters.tsx
+++ b/apps/web/features/users/components/UserFilters.tsx
@@ -3,6 +3,8 @@
import React, { useState, useEffect } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import { UserRole } from '../types';
+import { Card } from '@/components/ui/card';
+import { Input } from '@/components/ui/input';
export function UserFilters() {
const router = useRouter();
@@ -52,21 +54,20 @@ export function UserFilters() {
};
return (
-
+
- setSearch(e.target.value)}
- className="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"
/>
-
+
);
}
diff --git a/apps/web/features/users/components/UserForm.tsx b/apps/web/features/users/components/UserForm.tsx
index eba5f16..d9ff4f9 100644
--- a/apps/web/features/users/components/UserForm.tsx
+++ b/apps/web/features/users/components/UserForm.tsx
@@ -4,6 +4,9 @@ import React, { useState } from 'react';
import { useRouter } from 'next/navigation';
import { UserService } from '../api/users.api';
import { User, UserRole, CreateUserPayload, UpdateUserPayload } from '../types';
+import { Input } from '@/components/ui/input';
+import { Button } from '@/components/ui/button';
+import { Card, CardContent } from '@/components/ui/card';
interface UserFormProps {
user?: User; // If provided, we are editing. If not, creating.
@@ -70,101 +73,102 @@ export function UserForm({ user }: UserFormProps) {
};
return (
-