| 1 | import { ArrowLeft } from "lucide-react"; |
| 2 | import Link from "next/link |
| 3 | |
| 4 | import { FormSkeleton } |
| 5 | import { Skeleton } |
| 6 | import { ProfileAvatar } |
| 7 | import type { components |
| 8 | |
| 9 | import { DeleteOauthAppCard } |
| 10 | import { OauthAppCredentials } |
| 11 | import { OauthAppLogo } |
| 12 | import { OauthAppSettingsCard } |
| 13 | import { oauthAppsPath } |
| 14 | |
| 15 | /** One OAuth app: what it needs to connect, how it looks to people, its settings, and deleting it. */ |
| 16 | export function OauthAppDetail({ |
| 17 | app, |
| 18 | organization, |
| 19 | }: { |
| 20 | app: components |
| 21 | organization?: string |
| 22 | }) { |
| 23 | return ( |
| 24 | <div className="flex flex-col gap-8 |
| 25 | <div className="flex flex-col gap-3 |
| 26 | <Link |
| 27 | href={oauthAppsPath(organization |
| 28 | className="flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground" |
| 29 | > |
| 30 | <ArrowLeft className=" |
| 31 | OAuth apps |
| 32 | </Link> |
| 33 | <div className="flex items-center gap-3 |
| 34 | <ProfileAvatar |
| 35 | name={app.name |
| 36 | image={app.logoUrl |
| 37 | className="size-10 rounded-lg" |
| 38 | /> |
| 39 | <div className="flex min-w-0 flex-col |
| 40 | <h2 className="truncate text-lg font-semibold |
| 41 | <a |
| 42 | href={app.homepageUrl |
| 43 | target="_blank" |
| 44 | rel="noreferrer" |
| 45 | className="truncate text-sm text-muted-foreground hover:underline" |
| 46 | > |
| 47 | {app.homepageUrl} |
| 48 | </a> |
| 49 | </div> |
| 50 | </div> |
| 51 | </div> |
| 52 | <OauthAppCredentials app={ |
| 53 | <OauthAppLogo app={ |
| 54 | <OauthAppSettingsCard app={ |
| 55 | <DeleteOauthAppCard app={ |
| 56 | </div> |
| 57 | ); |
| 58 | } |
| 59 | |
| 60 | export function OauthAppDetailSkeleton() |
| 61 | return ( |
| 62 | <div className="flex flex-col gap-8 |
| 63 | <div className="flex items-center gap-3 |
| 64 | <Skeleton className=" |
| 65 | <div className="flex flex-col gap-1.5 |
| 66 | <Skeleton className=" |
| 67 | <Skeleton className=" |
| 68 | </div> |
| 69 | </div> |
| 70 | <FormSkeleton fields={ |
| 71 | <FormSkeleton fields={ |
| 72 | </div> |
| 73 | ); |
| 74 | } |