The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
display the response status
Kiran K48c3b46e3d8a
diff --git a/apps/web/ui/webhooks/webhook-events.tsx b/apps/web/ui/webhooks/webhook-events.tsxindex 42cae1eb18..82ea4f74c4 100644--- a/apps/web/ui/webhooks/webhook-events.tsx+++ b/apps/web/ui/webhooks/webhook-events.tsx@@ -8,34 +8,38 @@ export type EventListProps = PropsWithChildren<{events: WebhookEventProps[];}>;-const isSuccess = (status: number) => status >= 200 && status < 300;+const WebhookEvent = ({ event }: { event: WebhookEventProps }) => {+ const isSuccess = event.http_status >= 200 && event.http_status < 300;-export function WebhookEventList({ events }: EventListProps) {return (- <div className="rounded-xl border border-gray-200">- {/* Webhook Events */}+ <div className="flex cursor-pointer items-center justify-between gap-5 px-3.5 py-3 hover:bg-gray-50">+ <div className="flex items-center gap-5">+ <div className="flex items-center gap-2.5">+ {isSuccess ? (+ <CircleCheck className="size-4 text-green-500" />+ ) : (+ <Clock4 className="size-4 text-red-500" />+ )}+ <div className="text-sm text-gray-500">{event.http_status}</div>+ </div>+ <div className="text-sm text-gray-500">{event.event}</div>+ </div>++ <div className="text-xs text-gray-400">+ {new Date(event.timestamp).toLocaleString()}+ </div>+ </div>+ );+};++export const WebhookEventList = ({ events }: EventListProps) => {+ return (+ <div className="rounded-md border border-gray-200"><div className="flex flex-col divide-y divide-gray-200">{events.map((event, index) => (- <div- key={index}- className="flex items-center justify-between gap-5 px-3.5 py-4"- >- <div className="flex items-center gap-2.5">- <div>- {isSuccess(event.http_status) ? (- <CircleCheck className="size-4 text-green-500" />- ) : (- <Clock4 className="size-4 text-red-500" />- )}- </div>- <div className="text-sm text-gray-500">{event.event}</div>- </div>- <div className="text-xs text-gray-400">- {new Date(event.timestamp).toLocaleString()}- </div>- </div>+ <WebhookEvent key={index} event={event} />))}</div></div>);-}+};