diff --git a/src/app/(modules)/ticket/components/TicketColumns.tsx b/src/app/(modules)/ticket/components/TicketColumns.tsx
index 25e7fd8..cf97b0e 100644
--- a/src/app/(modules)/ticket/components/TicketColumns.tsx
+++ b/src/app/(modules)/ticket/components/TicketColumns.tsx
@@ -2,11 +2,48 @@
import { useMemo } from 'react';
import type { ColumnDef } from '@tanstack/react-table';
+import { CalendarClock, ClipboardCheck } from 'lucide-react';
+import { Badge } from '@/components/ui/badge';
import type { TicketListItem } from '@/types';
import { formatDate } from '@/utils/date';
+function TicketAttention({ ticket }: { ticket: TicketListItem }) {
+ const summary = ticket.attention_summary;
+ const reviewCount = summary?.pending_repair_review_count ?? 0;
+ const extensionCount = summary?.pending_extension_request_count ?? 0;
+ const showReview = reviewCount > 0;
+ const showExtension = extensionCount > 0;
+
+ if (!showReview && !showExtension) return null;
+
+ return (
+
+ {showReview ? (
+
+
+ Review
+ {reviewCount}
+
+ ) : null}
+ {showExtension ? (
+
+
+ Extension
+ +{extensionCount}
+
+ ) : null}
+
+ );
+}
+
export function useTicketColumns(): ColumnDef[] {
return useMemo(
() => [
@@ -29,6 +66,13 @@ export function useTicketColumns(): ColumnDef[] {
header: 'Detections',
size: 120,
},
+ {
+ id: 'attention',
+ header: 'Attention',
+ size: 210,
+ meta: { disableTruncate: true },
+ cell: ({ row }) => ,
+ },
{
id: 'created_by',
header: 'Uploaded By',
diff --git a/src/app/(modules)/ticket/hooks/useTenantTicketTableEvents.ts b/src/app/(modules)/ticket/hooks/useTenantTicketTableEvents.ts
index d889f24..9c56bef 100644
--- a/src/app/(modules)/ticket/hooks/useTenantTicketTableEvents.ts
+++ b/src/app/(modules)/ticket/hooks/useTenantTicketTableEvents.ts
@@ -103,6 +103,12 @@ function buildTicketListItem(
created_by_email: event.created_by_email ?? null,
created_at: event.created_at ?? event.updated_at,
updated_at: event.updated_at,
+ attention_summary: event.attention_summary ?? {
+ has_pending_extension_request: false,
+ pending_extension_request_count: 0,
+ has_pending_repair_review: false,
+ pending_repair_review_count: 0,
+ },
};
}
@@ -122,6 +128,7 @@ function mergeTicketListItem(
created_by_email: event.created_by_email ?? current.created_by_email,
created_at: event.created_at ?? current.created_at,
updated_at: event.updated_at ?? current.updated_at,
+ attention_summary: event.attention_summary ?? current.attention_summary,
};
}
diff --git a/src/app/globals.css b/src/app/globals.css
index aad9217..b6b08d0 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -7,7 +7,7 @@
@custom-variant dark (&:is(.dark *));
:root {
- --radius: 0.5rem;
+ --radius: 0.1rem;
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
diff --git a/src/types/ticket/events.ts b/src/types/ticket/events.ts
index 6697c09..22409af 100644
--- a/src/types/ticket/events.ts
+++ b/src/types/ticket/events.ts
@@ -1,4 +1,5 @@
import type { TicketStatus } from './status';
+import type { TicketAttentionSummary } from './list';
export interface SseTokenResponse {
sse_token: string;
@@ -18,6 +19,7 @@ export type TicketTableStatusEvent = {
created_by_email?: string | null;
created_at?: string;
updated_at?: string;
+ attention_summary?: TicketAttentionSummary;
message?: string;
};
diff --git a/src/types/ticket/list.ts b/src/types/ticket/list.ts
index 5c8da0b..98711eb 100644
--- a/src/types/ticket/list.ts
+++ b/src/types/ticket/list.ts
@@ -4,6 +4,13 @@ export interface TicketListParams extends PaginationParams {
chainage_id?: string;
}
+export interface TicketAttentionSummary {
+ has_pending_extension_request: boolean;
+ pending_extension_request_count: number;
+ has_pending_repair_review: boolean;
+ pending_repair_review_count: number;
+}
+
export interface TicketListItem {
id: string;
ticket_name: string;
@@ -15,6 +22,7 @@ export interface TicketListItem {
created_by_email: string | null;
created_at: string;
updated_at: string;
+ attention_summary: TicketAttentionSummary;
}
export interface TicketListResponse {