From f717600fcb1307e8ebe578a0d1d993e21522fc96 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Wed, 11 Jun 2025 03:40:01 +0400 Subject: [PATCH] style: trucate profile name in table after over 15 characters --- src/components/profile-data-table.tsx | 55 +++++++++++++++++---------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/src/components/profile-data-table.tsx b/src/components/profile-data-table.tsx index 17bc21b..1c12551 100644 --- a/src/components/profile-data-table.tsx +++ b/src/components/profile-data-table.tsx @@ -164,7 +164,7 @@ export function ProfilesDataTable({ const isDisabled = shouldDisableTorStart || isBrowserUpdating; return ( -
+
); }, enableSorting: true, sortingFn: "alphanumeric", + cell: ({ row }) => { + const profile = row.original; + return profile.name.length > 15 ? ( + + + {profile.name.slice(0, 15)}... + + {profile.name} + + ) : ( + profile.name + ); + }, }, { accessorKey: "browser", @@ -232,15 +245,15 @@ export function ProfilesDataTable({ onClick={() => { column.toggleSorting(column.getIsSorted() === "asc"); }} - className="h-auto p-0 font-semibold hover:bg-transparent" + className="p-0 h-auto font-semibold hover:bg-transparent" > Browser - {isSorted === "asc" && } + {isSorted === "asc" && } {isSorted === "desc" && ( - + )} {!isSorted && ( - + )} ); @@ -249,8 +262,8 @@ export function ProfilesDataTable({ const browser: string = row.getValue("browser"); const IconComponent = getBrowserIcon(browser); return ( -
- {IconComponent && } +
+ {IconComponent && } {getBrowserDisplayName(browser)}
); @@ -276,15 +289,15 @@ export function ProfilesDataTable({ onClick={() => { column.toggleSorting(column.getIsSorted() === "asc"); }} - className="h-auto p-0 font-semibold hover:bg-transparent" + className="p-0 h-auto font-semibold hover:bg-transparent" > Status - {isSorted === "asc" && } + {isSorted === "asc" && } {isSorted === "desc" && ( - + )} {!isSorted && ( - + )} ); @@ -335,9 +348,9 @@ export function ProfilesDataTable({ return ( -
+
{hasProxy && ( - + )} {hasProxy ? profile.proxy?.proxy_type : "Disabled"} @@ -363,16 +376,16 @@ export function ProfilesDataTable({ const isRunning = isClient && runningProfiles.has(profile.name); const isBrowserUpdating = isClient && isUpdating(profile.browser); return ( -
+
@@ -511,7 +524,7 @@ export function ProfilesDataTable({ Rename Profile
-
+