Skip to content

Commit

Permalink
better id cell
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalabbad committed Feb 17, 2025
1 parent 35bd505 commit de98ea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export interface TableRowIdentifierProps {
export function TableRowIdentifier({ objectKind, objectId, identifier }: TableRowIdentifierProps) {
const display = Array.isArray(identifier) ? identifier.join(", ") : identifier;
return (
<TableCell className="sticky left-0 bg-white">
<TableCell className="sticky left-0 bg-white px-1">
<LinkButton
variant="ghost"
size="sm"
to={getObjectDetailsUrl2(objectKind, objectId)}
className="underline truncate rounded-full text-custom-blue-700 hover:bg-custom-blue-700/10"
className="truncate px-2.5 rounded-full text-custom-blue-700 hover:underline hover:bg-custom-blue-700/10"
>
{display}
</LinkButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export const getObjectTableColumns = (
return [
{
id: "id",
accessorFn: (row) => row.hfid ?? row.display_label ?? row.id,
accessorFn: ({ hfid, display_label, id }): string => {
if (schema.human_friendly_id && hfid) return hfid;
if (schema.display_labels && display_label) return display_label;
return id;
},
header: () => (
<div className={classNames(cellsStyle, cellHeaderStyle, "left-0 z-10 hover:bg-white")}>
{schema.icon && <Icon icon={schema.icon} className="text-stone-400" />}
Expand Down

0 comments on commit de98ea1

Please sign in to comment.