11"use client" ;
22
3- import { format } from "date-fns" ;
3+ import { formatDate , formatDistanceToNow } from "date-fns" ;
44import { XIcon } from "lucide-react" ;
55import Link from "next/link" ;
66import { useState } from "react" ;
@@ -15,6 +15,7 @@ import {
1515 TableHeader ,
1616 TableRow ,
1717} from "@/components/ui/table" ;
18+ import { ToolTipLabel } from "@/components/ui/tooltip" ;
1819import type { SupportTicketListItem } from "../types/tickets" ;
1920import {
2021 getTicketStatusBadgeVariant ,
@@ -133,7 +134,7 @@ export function SupportsCaseList({
133134 linkBox
134135 className = "hover:bg-accent/50 cursor-pointer"
135136 >
136- < TableCell className = "py-6 " >
137+ < TableCell className = "py-5 " >
137138 < Link
138139 className = "text-foreground font-medium text-sm before:absolute before:inset-0"
139140 href = { `/team/${ team . slug } /~/support/cases/${ ticket . id } ` }
@@ -142,15 +143,23 @@ export function SupportsCaseList({
142143 </ Link >
143144 </ TableCell >
144145 < TableCell >
145- < Badge
146- variant = { getTicketStatusBadgeVariant ( ticket . status ) }
147- className = "text-sm"
148- >
146+ < Badge variant = { getTicketStatusBadgeVariant ( ticket . status ) } >
149147 { getTicketStatusLabel ( ticket . status ) }
150148 </ Badge >
151149 </ TableCell >
152- < TableCell className = "text-muted-foreground text-sm" >
153- { format ( new Date ( ticket . updatedAt ) , "MMM d, yyyy" ) }
150+ < TableCell >
151+ < ToolTipLabel
152+ label = { formatDate (
153+ new Date ( ticket . updatedAt ) ,
154+ "MMM d, yyyy 'at' hh:mm a" ,
155+ ) }
156+ >
157+ < div className = "text-sm flex items-center gap-2 z-10 relative" >
158+ { formatDistanceToNow ( new Date ( ticket . updatedAt ) , {
159+ addSuffix : true ,
160+ } ) }
161+ </ div >
162+ </ ToolTipLabel >
154163 </ TableCell >
155164 </ TableRow >
156165 ) ) }
0 commit comments