"use client"; import { useState, useEffect } from "react"; import AdvancedIntegrations from "@/components/admin/AdvancedIntegrations"; import AdvancedAIPanel from "@/components/admin/AdvancedAIPanel"; import AdvancedSquareSync from "@/components/admin/AdvancedSquareSync"; import AdvancedShipping from "@/components/admin/AdvancedShipping"; import AdvancedPayments from "@/components/admin/AdvancedPayments"; type Tab = "integrations" | "ai" | "square" | "shipping" | "webhooks" | "payments"; const TABS: { id: Tab; label: string; icon: string }[] = [ { id: "integrations", label: "Integrations", icon: "plug" }, { id: "ai", label: "AI Tools", icon: "sparkles" }, { id: "square", label: "Square Sync", icon: "square" }, { id: "shipping", label: "Shipping", icon: "truck" }, { id: "webhooks", label: "Webhooks", icon: "webhook" }, { id: "payments", label: "Payments", icon: "credit-card" }, ]; // Icon components const Icons = { plug: (className: string) => ( ), sparkles: (className: string) => ( ), square: (className: string) => ( ), truck: (className: string) => ( ), webhook: (className: string) => ( ), "credit-card": (className: string) => ( ), }; type Props = { brandId: string; brands: { id: string; name: string }[]; stripeConnect?: { is_connected: boolean; account_id?: string; charges_enabled?: boolean; payouts_enabled?: boolean; details_submitted?: boolean; } | null; }; export default function AdvancedSettingsClient({ brandId, brands, stripeConnect }: Props) { const [activeTab, setActiveTab] = useState("integrations"); // Handle Stripe Connect callback params useEffect(() => { const params = new URLSearchParams(window.location.search); if (params.get("stripe_connected") === "true") { // Successfully connected - could show a toast or refresh window.history.replaceState({}, "", window.location.pathname); } else if (params.get("stripe_refresh") === "true") { // Link expired, need to refresh window.history.replaceState({}, "", window.location.pathname); } }, []); return (
{/* Tab navigation */} {/* Content */}
{activeTab === "integrations" && ( )} {activeTab === "ai" && ( )} {activeTab === "square" && ( )} {activeTab === "shipping" && ( )} {activeTab === "webhooks" && (
{/* Page Header */}
{Icons.webhook("h-6 w-6 text-[var(--admin-text-muted)]")}

Webhooks

Configure webhook endpoints to receive real-time notifications for order events, payments, and inventory updates.

{/* Coming Soon Card */}

Available Webhook Events

Coming Soon

Webhook configuration will be available shortly

{[ { icon: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4", label: "Order Status Changes", desc: "Track order lifecycle events" }, { icon: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z", label: "Payment Confirmations", desc: "Get notified on successful payments" }, { icon: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4", label: "Inventory Updates", desc: "Real-time stock changes" }, { icon: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1", label: "Custom Webhook URLs", desc: "Send events to your endpoint" }, ].map((event, i) => (

{event.label}

{event.desc}

))}
Webhook configuration will allow you to receive events via HTTP POST to your custom endpoint.

Need webhooks now?{" "}

{/* Technical Info Card */}

Webhook Payload Format

{`{
  "event": "order.status_changed",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "order_id": "...",
    "status": "delivered"
  }
}`}
                
)} {activeTab === "payments" && ( )}
); }