Files
Gildas Garcia b30db91d71 chore: cleanup UI patterns exports (#47406)
## Problem

We now export components under a subpath in ui-patterns to avoid barrel
files as they slow down every tools (from IDE to linters, etc.) and may
also affect bundles our users have to download.

## Solution

- Remove the UI patterns index file
- Fix invalid impors
2026-06-30 09:23:17 +02:00

56 lines
1.7 KiB
TypeScript

import { Trash } from 'lucide-react'
import { Button, TableCell, TableRow } from 'ui'
import { TimestampInfo } from 'ui-patterns/TimestampInfo'
import CopyButton from '@/components/ui/CopyButton'
import type { AuthorizedApp } from '@/data/oauth/authorized-apps-query'
export interface AuthorizedAppRowProps {
app: AuthorizedApp
onSelectRevoke: () => void
}
export const AuthorizedAppRow = ({ app, onSelectRevoke }: AuthorizedAppRowProps) => {
return (
<TableRow>
<TableCell className="w-[62px] min-w-[62px] max-w-[62px]">
<div
className="w-[30px] h-[30px] rounded-full bg-no-repeat bg-cover bg-center border border-control flex items-center justify-center text-xs"
style={{ backgroundImage: app.icon ? `url('${app.icon}')` : 'none' }}
>
{!!app.icon ? '' : `${app.name[0]}`}
</div>
</TableCell>
<TableCell>
<p className="truncate" title={app.name}>
{app.name}
</p>
</TableCell>
<TableCell>{app.created_by}</TableCell>
<TableCell>
<div className="flex items-center gap-x-2">
<p className="text-xs font-mono truncate" title={app.app_id}>
{app.app_id}
</p>
<CopyButton iconOnly variant="default" text={app.app_id} className="px-1" />
</div>
</TableCell>
<TableCell>
<TimestampInfo
utcTimestamp={app.authorized_at ?? ''}
labelFormat="DD/MM/YYYY, HH:mm:ss"
className="text-sm"
/>
</TableCell>
<TableCell className="text-right">
<Button
variant="default"
icon={<Trash />}
className="px-1"
onClick={() => onSelectRevoke()}
/>
</TableCell>
</TableRow>
)
}