"use client"
import { useState } from "react"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Badge } from "@/components/ui/badge"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { Switch } from "@/components/ui/switch"
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
import {
Webhook, Plus, Settings, Trash2, Play, Pause,
CheckCircle2, XCircle, Clock, RefreshCw, Eye
} from "lucide-react"
const subscriptions = [
{
id: "1",
name: "用户标签变更通知",
type: "webhook",
endpoint: "https://api.example.com/webhook/tags",
event: "tag_changed",
status: "active",
lastTriggered: "2024-01-15 14:20:00",
successRate: 99.5,
},
{
id: "2",
name: "高价值用户预警",
type: "webhook",
endpoint: "https://api.example.com/webhook/alerts",
event: "high_value_alert",
status: "active",
lastTriggered: "2024-01-15 10:15:00",
successRate: 98.2,
},
{
id: "3",
name: "数据同步完成通知",
type: "email",
endpoint: "admin@example.com",
event: "sync_completed",
status: "paused",
lastTriggered: "2024-01-14 23:00:00",
successRate: 100,
},
]
export default function SubscriptionPage() {
const [showCreateDialog, setShowCreateDialog] = useState(false)
const getStatusBadge = (status: string) => {
switch (status) {
case "active":
return
配置数据变更的实时推送和通知
订阅总数
8
今日推送
1,256
成功率
99.2%
活跃订阅
6