Skip to content

Commit

Permalink
feat(merchant-monitoring): add Merchant ID column with copy functiona…
Browse files Browse the repository at this point in the history
…lity (#3112)

- Implement Merchant ID column displaying business correlation ID
- Include copy to clipboard button for easy ID duplication
- Utilize ellipses for long IDs to maintain table layout
  • Loading branch information
shanegrouber authored Feb 27, 2025
1 parent 2f964a0 commit 588cd2c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,24 @@ export const columns = [
},
header: 'Report ID',
}),
columnHelper.accessor('business.correlationId', {
cell: info => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- ESLint doesn't like `cell` not being `Cell`.
const { ref, styles } = useEllipsesWithTitle<HTMLSpanElement>();
const merchantId = info.getValue() ?? info.row.original.business?.id;

return (
<div className={`flex w-full max-w-[12ch] items-center space-x-2`}>
<TextWithNAFallback style={{ ...styles, width: '70%' }} ref={ref}>
{merchantId}
</TextWithNAFallback>

<CopyToClipboardButton textToCopy={merchantId ?? ''} />
</div>
);
},
header: 'Merchant ID',
}),
columnHelper.accessor('status', {
meta: {
useWrapper: true,
Expand Down

0 comments on commit 588cd2c

Please sign in to comment.