From ed8c8bedcd3063249e9c90a47ef682fcb5ec51ca Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 30 Mar 2026 21:46:11 -0700 Subject: [PATCH] Add picker --- .../[orgId]/settings/logs/streaming/page.tsx | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/app/[orgId]/settings/logs/streaming/page.tsx b/src/app/[orgId]/settings/logs/streaming/page.tsx index a89c961b4..84b201260 100644 --- a/src/app/[orgId]/settings/logs/streaming/page.tsx +++ b/src/app/[orgId]/settings/logs/streaming/page.tsx @@ -31,6 +31,8 @@ import { Checkbox } from "@app/components/ui/checkbox"; import { Globe, Plus, X } from "lucide-react"; import { AxiosResponse } from "axios"; import { build } from "@server/build"; +import Image from "next/image"; +import { StrategySelect, StrategyOption } from "@app/components/StrategySelect"; // ── Types ────────────────────────────────────────────────────────────────────── @@ -263,6 +265,97 @@ function AddDestinationCard({ ); } +// ── Destination type picker ──────────────────────────────────────────────────── + +type DestinationType = "http" | "s3" | "datadog"; + +const destinationTypeOptions: ReadonlyArray> = [ + { + id: "http", + title: "HTTP Webhook", + description: + "Send events to any HTTP endpoint with flexible authentication and templating.", + icon: + }, + { + id: "s3", + title: "Amazon S3", + description: "Stream events to an S3-compatible object storage bucket. Coming soon.", + disabled: true, + icon: ( + Amazon S3 + ) + }, + { + id: "datadog", + title: "Datadog", + description: "Forward events directly to your Datadog account. Coming soon.", + disabled: true, + icon: ( + Datadog + ) + } +]; + +interface DestinationTypePickerProps { + open: boolean; + onOpenChange: (open: boolean) => void; + onSelect: (type: DestinationType) => void; +} + +function DestinationTypePicker({ + open, + onOpenChange, + onSelect +}: DestinationTypePickerProps) { + const [selected, setSelected] = useState("http"); + + useEffect(() => { + if (open) setSelected("http"); + }, [open]); + + return ( + + + + Add Destination + + Choose a destination type to get started. + + + + + + + + + + + + + + ); +} + // ── Destination modal ────────────────────────────────────────────────────────── interface DestinationModalProps { @@ -898,6 +991,7 @@ export default function StreamingDestinationsPage() { const [destinations, setDestinations] = useState([]); const [loading, setLoading] = useState(true); const [modalOpen, setModalOpen] = useState(false); + const [typePickerOpen, setTypePickerOpen] = useState(false); const [editingDestination, setEditingDestination] = useState(null); const [togglingIds, setTogglingIds] = useState>(new Set()); @@ -972,6 +1066,11 @@ export default function StreamingDestinationsPage() { }; const openCreate = () => { + setTypePickerOpen(true); + }; + + const handleTypePicked = (_type: DestinationType) => { + setTypePickerOpen(false); setEditingDestination(null); setModalOpen(true); }; @@ -1018,6 +1117,12 @@ export default function StreamingDestinationsPage() { )} + +