| 1 | import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; |
| 2 | import type { components |
| 3 | import type { WebhookOwner |
| 4 | |
| 5 | import { DeleteWebhookCard } |
| 6 | import { RollSecretCard } |
| 7 | import { |
| 8 | WebhookDeliveries, |
| 9 | WebhookDeliveriesSkeleton, |
| 10 | } from "./webhook-deliveries"; |
| 11 | import { |
| 12 | WebhookSettingsCard, |
| 13 | WebhookSettingsCardSkeleton, |
| 14 | } from "./webhook-settings-card"; |
| 15 | |
| 16 | export function WebhookDetail({ |
| 17 | owner, |
| 18 | webhook, |
| 19 | deliveries, |
| 20 | }: { |
| 21 | owner: WebhookOwner |
| 22 | webhook: components |
| 23 | deliveries: components |
| 24 | }) { |
| 25 | return ( |
| 26 | <div className="flex flex-col gap-8 |
| 27 | {!webhook.active |
| 28 | <Alert variant=" |
| 29 | <AlertTitle>Ghost turned this webhook off</AlertTitle |
| 30 | <AlertDescription> |
| 31 | {webhook.disabledReason} Turn it back on below once the receiver is |
| 32 | fixed. |
| 33 | </AlertDescription> |
| 34 | </Alert> |
| 35 | )} |
| 36 | <WebhookSettingsCard owner={ |
| 37 | <WebhookDeliveries |
| 38 | owner={owner} |
| 39 | webhookId={webhook.id |
| 40 | deliveries={deliveries} |
| 41 | /> |
| 42 | <RollSecretCard owner={ |
| 43 | <DeleteWebhookCard owner={ |
| 44 | </div> |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | export function WebhookDetailSkeleton() |
| 49 | return ( |
| 50 | <div className="flex flex-col gap-8 |
| 51 | <WebhookSettingsCardSkeleton /> |
| 52 | <WebhookDeliveriesSkeleton /> |
| 53 | </div> |
| 54 | ); |
| 55 | } |