Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion web/sdk/admin/views/organizations/details/tokens/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Flex,
getAvatarColor,
Text,
Tooltip,
} from "@raystack/apsara";
import type {
SearchOrganizationTokensResponse_OrganizationToken,
Expand All @@ -29,6 +30,7 @@ export const getColumns = (): DataTableColumnDef<
cell: styles["first-column"],
header: styles["first-column"],
},
styles: { header: { width: "180px" } },
cell: ({ getValue }) => {
const value = getValue() as TimeStamp;
const date = isNullTimestamp(value)
Expand All @@ -43,6 +45,7 @@ export const getColumns = (): DataTableColumnDef<
{
accessorKey: "amount",
header: "Tokens",
styles: { header: { width: "220px" } },
cell: ({ row, getValue }) => {
const prefix = row.original.type === "credit" ? "+" : "-";
const value = getValue() as number;
Expand All @@ -55,8 +58,15 @@ export const getColumns = (): DataTableColumnDef<
{
accessorKey: "description",
header: "Events",
classNames: { cell: styles["truncate-tooltip-wrapper"] },
cell: ({ getValue }) => {
return getValue();
const text = (getValue() as string) ?? "";
if (!text) return text;
return (
<Tooltip message={text} delayDuration={500}>
<span className={styles["truncate-text"]}>{text}</span>
</Tooltip>
);
},
enableHiding: true,
},
Expand Down
12 changes: 12 additions & 0 deletions web/sdk/admin/views/organizations/details/tokens/tokens.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
.first-column {
padding-left: var(--rs-space-7);
}

/* Target Tooltip's root element (direct child of wrapper) – constrains width so inner text can truncate */
.truncate-tooltip-wrapper>* {
width: 100%;
}

.truncate-text {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Comment thread
paanSinghCoder marked this conversation as resolved.
}
Loading