"use client" import { useState, useEffect } from "react" import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { toast } from "@/components/ui/use-toast" interface PlanSettingsDialogProps { open: boolean onOpenChange: (open: boolean) => void planId: string } export function PlanSettingsDialog({ open, onOpenChange, planId }: PlanSettingsDialogProps) { const [planName, setPlanName] = useState("") const [isActive, setIsActive] = useState(true) const [frequency, setFrequency] = useState("daily") const [isLoading, setIsLoading] = useState(false) // Simulate loading plan data useEffect(() => { if (open && planId) { // In a real app, you would fetch the plan data here setPlanName(`获客计划 ${planId}`) setIsActive(true) setFrequency("daily") } }, [open, planId]) const handleSave = () => { setIsLoading(true) // Simulate API call setTimeout(() => { setIsLoading(false) onOpenChange(false) toast({ title: "计划已更新", description: "获客计划设置已成功保存", }) }, 1000) } return ( 编辑获客计划
setPlanName(e.target.value)} className="col-span-3" />
) }