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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface Transaction {
user?: {
id: string | null;
name: string | null;
email: string | null;
image: string | null;
};
date: Date;
Expand Down Expand Up @@ -111,7 +112,10 @@ const TransactionRow = ({ transaction }: { transaction: Transaction }) => {
<div className="flex flex-col items-start">
<p className="text-sm leading-tight">
<span className="font-medium">
{transaction.user?.name ?? 'x402 Users'}
{transaction.user?.name ??
(transaction.user?.email
? `${transaction.user.id}`
: 'Unknown User')}
</span>{' '}
made {transaction.callCount} requests
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const UsersTable: React.FC<Props> = ({ appId }) => {
...rows.map(row =>
[
`"${row.name ?? ''}"`,
`"${row.email || ''}"`,
`"${row.email ?? ''}"`,
row.usage.totalTransactions,
row.usage.rawCost,
row.usage.markupProfit,
Expand Down Expand Up @@ -187,7 +187,9 @@ const UserRow = ({ user, showEmail }: { user: User; showEmail: boolean }) => {
<TableCell className="pl-4">
<div className="flex flex-row items-center gap-2">
<UserAvatar src={user.image} className="size-6" />
<p className="text-sm font-medium">{user.name}</p>
<p className="text-sm font-medium">
{user.name ?? (user.email ? `${user.id}` : 'Unknown User')}
</p>
</div>
</TableCell>
{showEmail && (
Expand Down
3 changes: 3 additions & 0 deletions packages/app/control/src/services/db/apps/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const listAppTransactions = async (
select: {
id: true,
name: true,
email: true,
image: true,
},
},
Expand All @@ -69,6 +70,7 @@ export const listAppTransactions = async (
user: {
id: string | null;
name: string | null;
email: string | null;
image: string | null;
};
date: Date;
Expand All @@ -93,6 +95,7 @@ export const listAppTransactions = async (
id: transaction.id,
user: {
id: transaction.userId,
email: transaction.user?.email ?? null,
name:
transaction.user?.name ??
(transaction.userId === null ? 'x402 Users' : null),
Expand Down
Loading