diff --git a/app/(app)/tickets/page.tsx b/app/(app)/tickets/page.tsx index 1c6cdf4..7b4f25f 100644 --- a/app/(app)/tickets/page.tsx +++ b/app/(app)/tickets/page.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; -import { RefreshCw, Ticket, Plus, Send, RotateCcw, User } from "lucide-react"; +import { RefreshCw, Ticket, Plus, Send, RotateCcw, User, MapPin, Zap } from "lucide-react"; import { useAuth } from "@/contexts/AuthContext"; import { Card, CardContent, CardHeader } from "@/components/ui/Card"; import { Table, TableHead, TableBody, TableRow, Th, Td, EmptyState } from "@/components/ui/Table"; @@ -120,6 +120,14 @@ export default function TicketsPage() { onError: (e: any) => toast.error(e.response?.data?.message ?? "Failed to create ticket"), }); + const activateClient = useMutation({ + mutationFn: async (clientId: string) => { + await api.patch(`/api/v1/clients/${clientId}`, { isActive: true }); + }, + onSuccess: () => { toast.success("Client activated! 🎉"); refetch(); refetchDetail(); }, + onError: (e: any) => toast.error(e.response?.data?.message ?? "Failed to activate client"), + }); + const revertStatus = useMutation({ mutationFn: async ({ id, status }: { id: string; status: string }) => { await api.patch(`/api/v1/tickets/${id}`, { status }); @@ -226,6 +234,21 @@ export default function TicketsPage() {
{formatDate(detail.createdAt)}
{detail.description}