mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-25 19:15:18 +02:00
refactor: update ApprovalCard to display account names instead of emails across Gmail tools
This commit is contained in:
parent
9b38626723
commit
282e913c50
3 changed files with 9 additions and 11 deletions
|
|
@ -275,7 +275,7 @@ function ApprovalCard({
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{validAccounts.map((account) => (
|
{validAccounts.map((account) => (
|
||||||
<SelectItem key={account.id} value={String(account.id)}>
|
<SelectItem key={account.id} value={String(account.id)}>
|
||||||
{account.email}
|
{account.name}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
{expiredAccounts.map((a) => (
|
{expiredAccounts.map((a) => (
|
||||||
|
|
@ -283,7 +283,7 @@ function ApprovalCard({
|
||||||
key={a.id}
|
key={a.id}
|
||||||
className="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 px-2 text-sm select-none opacity-50 pointer-events-none"
|
className="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 px-2 text-sm select-none opacity-50 pointer-events-none"
|
||||||
>
|
>
|
||||||
{a.email} (expired, retry after re-auth)
|
{a.name} (expired, retry after re-auth)
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
|
|
|
||||||
|
|
@ -264,8 +264,7 @@ function ApprovalCard({
|
||||||
{interruptData.context.error ? (
|
{interruptData.context.error ? (
|
||||||
<p className="text-sm text-destructive">{interruptData.context.error}</p>
|
<p className="text-sm text-destructive">{interruptData.context.error}</p>
|
||||||
) : (
|
) : (
|
||||||
<>
|
accounts.length > 0 && (
|
||||||
{accounts.length > 0 && (
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<p className="text-xs font-medium text-muted-foreground">
|
<p className="text-xs font-medium text-muted-foreground">
|
||||||
Gmail Account <span className="text-destructive">*</span>
|
Gmail Account <span className="text-destructive">*</span>
|
||||||
|
|
@ -277,7 +276,7 @@ function ApprovalCard({
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{validAccounts.map((account) => (
|
{validAccounts.map((account) => (
|
||||||
<SelectItem key={account.id} value={String(account.id)}>
|
<SelectItem key={account.id} value={String(account.id)}>
|
||||||
{account.email}
|
{account.name}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
{expiredAccounts.map((a) => (
|
{expiredAccounts.map((a) => (
|
||||||
|
|
@ -285,14 +284,13 @@ function ApprovalCard({
|
||||||
key={a.id}
|
key={a.id}
|
||||||
className="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 px-2 text-sm select-none opacity-50 pointer-events-none"
|
className="relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 px-2 text-sm select-none opacity-50 pointer-events-none"
|
||||||
>
|
>
|
||||||
{a.email} (expired, retry after re-auth)
|
{a.name} (expired, retry after re-auth)
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
@ -307,13 +305,13 @@ function ApprovalCard({
|
||||||
<span>To: {pendingEdits?.to ?? args.to}</span>
|
<span>To: {pendingEdits?.to ?? args.to}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{(pendingEdits?.cc ?? args.cc) && (pendingEdits?.cc ?? args.cc)!.trim() !== "" && (
|
{(pendingEdits?.cc ?? args.cc) && (pendingEdits?.cc ?? args.cc)?.trim() !== "" && (
|
||||||
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
||||||
<UsersIcon className="size-3 shrink-0" />
|
<UsersIcon className="size-3 shrink-0" />
|
||||||
<span>CC: {pendingEdits?.cc ?? args.cc}</span>
|
<span>CC: {pendingEdits?.cc ?? args.cc}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{(pendingEdits?.bcc ?? args.bcc) && (pendingEdits?.bcc ?? args.bcc)!.trim() !== "" && (
|
{(pendingEdits?.bcc ?? args.bcc) && (pendingEdits?.bcc ?? args.bcc)?.trim() !== "" && (
|
||||||
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
||||||
<UsersIcon className="size-3 shrink-0" />
|
<UsersIcon className="size-3 shrink-0" />
|
||||||
<span>BCC: {pendingEdits?.bcc ?? args.bcc}</span>
|
<span>BCC: {pendingEdits?.bcc ?? args.bcc}</span>
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ function ApprovalCard({
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<p className="text-xs font-medium text-muted-foreground">Gmail Account</p>
|
<p className="text-xs font-medium text-muted-foreground">Gmail Account</p>
|
||||||
<div className="w-full rounded-md border border-input bg-muted/50 px-3 py-2 text-sm">
|
<div className="w-full rounded-md border border-input bg-muted/50 px-3 py-2 text-sm">
|
||||||
{account.email}
|
{account.name}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue