11import type { RowKey } from "@repo/ui/components/Table" ;
22
33import { t } from "@lingui/core/macro" ;
4- import { useLingui } from "@lingui/react" ;
54import { Trans } from "@lingui/react/macro" ;
6- import { Badge } from "@repo/ui/components/Badge" ;
75import { Empty , EmptyDescription , EmptyHeader , EmptyTitle } from "@repo/ui/components/Empty" ;
86import { Skeleton } from "@repo/ui/components/Skeleton" ;
97import { Table , TableBody , TableCell , TableHead , TableHeader , TableRow } from "@repo/ui/components/Table" ;
@@ -14,13 +12,15 @@ import { useCallback } from "react";
1412
1513import { SmartDateTime } from "@/shared/components/SmartDateTime" ;
1614import { api } from "@/shared/lib/api/client" ;
17- import { getSubscriptionPlanLabel } from "@/shared/lib/api/labels" ;
18- import { getCountryFlagEmoji , getCountryName } from "@/shared/lib/countryFlag" ;
1915
2016import { DashboardCardShell } from "./DashboardCardShell" ;
2117
18+ function getOwnerDisplayName ( owner : { firstName : string | null ; lastName : string | null ; email : string } ) : string {
19+ const fullName = [ owner . firstName , owner . lastName ] . filter ( ( part ) => part != null && part . trim ( ) !== "" ) . join ( " " ) ;
20+ return fullName !== "" ? fullName : owner . email ;
21+ }
22+
2223export function DashboardRecentSignupsCard ( ) {
23- const { i18n } = useLingui ( ) ;
2424 const navigate = useNavigate ( ) ;
2525 const { data, isLoading } = api . useQuery ( "get" , "/api/back-office/dashboard/recent-signups" , {
2626 params : { query : { Limit : 6 } }
@@ -64,17 +64,20 @@ export function DashboardRecentSignupsCard() {
6464 </ EmptyHeader >
6565 </ Empty >
6666 ) : (
67- < Table rowSize = "compact" aria-label = { t `Recent signups` } selectionMode = "single" onActivate = { handleActivate } >
67+ < Table
68+ rowSize = "compact"
69+ aria-label = { t `Recent signups` }
70+ selectionMode = "single"
71+ onActivate = { handleActivate }
72+ containerClassName = "border-0 bg-transparent"
73+ >
6874 < TableHeader >
6975 < TableRow >
7076 < TableHead >
7177 < Trans > Account</ Trans >
7278 </ TableHead >
7379 < TableHead className = "hidden md:table-cell" >
74- < Trans > Plan</ Trans >
75- </ TableHead >
76- < TableHead className = "hidden md:table-cell" >
77- < Trans > Country</ Trans >
80+ < Trans > Owner</ Trans >
7881 </ TableHead >
7982 < TableHead className = "text-right" >
8083 < Trans > Created</ Trans >
@@ -96,16 +99,8 @@ export function DashboardRecentSignupsCard() {
9699 </ div >
97100 </ TableCell >
98101 < TableCell className = "hidden md:table-cell" >
99- < Badge variant = "secondary" className = "text-xs" >
100- { getSubscriptionPlanLabel ( signup . plan ) }
101- </ Badge >
102- </ TableCell >
103- < TableCell className = "hidden md:table-cell" >
104- { signup . country ? (
105- < span className = "inline-flex items-center gap-1.5 text-sm" >
106- < span aria-hidden = "true" > { getCountryFlagEmoji ( signup . country ) } </ span >
107- < span className = "truncate" > { getCountryName ( signup . country , i18n . locale ) } </ span >
108- </ span >
102+ { signup . owner ? (
103+ < span className = "truncate text-sm" > { getOwnerDisplayName ( signup . owner ) } </ span >
109104 ) : (
110105 < span className = "text-muted-foreground" > —</ span >
111106 ) }
0 commit comments