Files
cunkebao_v3/Cunkebao/app/workspace/moments-sync/new/steps/BasicSettings.tsx
2025-04-10 16:40:30 +08:00

140 lines
4.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client"
import { Card } from "@/components/ui/card"
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 { Minus, Plus, HelpCircle } from "lucide-react"
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"
interface BasicSettingsProps {
formData: any
onChange: (data: any) => void
onNext: () => void
}
export function BasicSettings({ formData, onChange, onNext }: BasicSettingsProps) {
return (
<Card className="p-6">
<div className="space-y-6">
<div>
<Label htmlFor="taskName" className="required">
</Label>
<Input
id="taskName"
value={formData.taskName}
onChange={(e) => onChange({ ...formData, taskName: e.target.value })}
placeholder="请输入任务名称"
className="mt-2"
/>
</div>
<div>
<Label></Label>
<div className="flex items-center space-x-2 mt-2">
<Input
type="time"
value={formData.startTime}
onChange={(e) => onChange({ ...formData, startTime: e.target.value })}
className="w-32"
/>
<span></span>
<Input
type="time"
value={formData.endTime}
onChange={(e) => onChange({ ...formData, endTime: e.target.value })}
className="w-32"
/>
</div>
</div>
<div>
<Label></Label>
<div className="flex items-center space-x-4 mt-2">
<Button
variant="outline"
size="icon"
onClick={() => onChange({ ...formData, syncCount: Math.max(1, formData.syncCount - 1) })}
aria-label="减少同步数量"
>
<Minus className="h-4 w-4" />
</Button>
<span className="w-12 text-center bg-primary text-primary-foreground rounded-md px-3 py-1 font-medium">
{formData.syncCount}
</span>
<Button
variant="outline"
size="icon"
onClick={() => onChange({ ...formData, syncCount: formData.syncCount + 1 })}
aria-label="增加同步数量"
>
<Plus className="h-4 w-4" />
</Button>
<span className="text-gray-500"></span>
</div>
</div>
<div>
<Label></Label>
<div className="flex space-x-4 mt-2">
<div className="flex items-center">
<Button
variant={formData.accountType === "business" ? "default" : "outline"}
onClick={() => onChange({ ...formData, accountType: "business" })}
className="w-24"
>
</Button>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<HelpCircle className="h-4 w-4 ml-2 text-gray-400" />
</TooltipTrigger>
<TooltipContent>
<p>
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<div className="flex items-center">
<Button
variant={formData.accountType === "personal" ? "default" : "outline"}
onClick={() => onChange({ ...formData, accountType: "personal" })}
className="w-24"
>
</Button>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<HelpCircle className="h-4 w-4 ml-2 text-gray-400" />
</TooltipTrigger>
<TooltipContent>
<p></p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
</div>
</div>
<div className="flex items-center justify-between">
<Label></Label>
<Switch
checked={formData.enabled}
onCheckedChange={(checked) => onChange({ ...formData, enabled: checked })}
/>
</div>
<Button className="w-full" onClick={onNext}>
</Button>
</div>
</Card>
)
}