Files
supabase/apps/studio/components/interfaces/Organization/OAuthApps/AuthorizedAppRow.tsx
T
Joshen Lim 98a5f06070 Chore/next round of refactoring rqs to use data fetchers (#33556)
* Update several files to use data fetcher methods

* Remove unused files from lib/common/fetch

* Revert "Remove unused files from lib/common/fetch"

This reverts commit b314b05f06.

* Fix GraphQL

* Fix types

* Add IS_PLATFORM check in useOrgUsageQuery

* Fix type issues
2025-02-17 15:23:38 +08:00

34 lines
1.1 KiB
TypeScript

import dayjs from 'dayjs'
import { Trash } from 'lucide-react'
import Table from 'components/to-be-cleaned/Table'
import type { AuthorizedApp } from 'data/oauth/authorized-apps-query'
import { Button } from 'ui'
export interface AuthorizedAppRowProps {
app: AuthorizedApp
onSelectRevoke: () => void
}
const AuthorizedAppRow = ({ app, onSelectRevoke }: AuthorizedAppRowProps) => {
return (
<Table.tr>
<Table.td>
<div
className="w-[30px] h-[30px] rounded-full bg-no-repeat bg-cover bg-center border border-control flex items-center justify-center"
style={{ backgroundImage: app.icon ? `url('${app.icon}')` : 'none' }}
>
{!!app.icon ? '' : `${app.name[0]}`}
</div>
</Table.td>
<Table.td>{app.name}</Table.td>
<Table.td>{dayjs(app.authorized_at).format('DD/MM/YYYY, HH:mm:ss')}</Table.td>
<Table.td align="right">
<Button type="default" icon={<Trash />} className="px-1" onClick={() => onSelectRevoke()} />
</Table.td>
</Table.tr>
)
}
export default AuthorizedAppRow