"use client" import { useState } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" import { Slider } from "@/components/ui/slider" import { Input } from "@/components/ui/input" import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip" import { Info, Trash2 } from "lucide-react" import { Badge } from "@/components/ui/badge" export interface LikeConfigData { taskName: string maxLikesPerDay: number likeOldContent: boolean contentTypes: string[] keywordFilters: string[] startImmediately: boolean likeFirstPageOnly: boolean } interface LikeConfigProps { initialData?: Partial onSave: (data: LikeConfigData) => void onBack: () => void } export function LikeConfig({ initialData, onSave, onBack }: LikeConfigProps) { const [formData, setFormData] = useState({ taskName: initialData?.taskName ?? "朋友圈自动点赞任务", maxLikesPerDay: initialData?.maxLikesPerDay ?? 50, likeOldContent: initialData?.likeOldContent ?? false, contentTypes: initialData?.contentTypes ?? ["text", "image", "video"], keywordFilters: initialData?.keywordFilters ?? [], startImmediately: initialData?.startImmediately ?? true, likeFirstPageOnly: initialData?.likeFirstPageOnly ?? false, }) const [newKeyword, setNewKeyword] = useState("") // 内容类型选项 const contentTypeOptions = [ { id: "text", label: "纯文字动态" }, { id: "image", label: "图片动态" }, { id: "video", label: "视频动态" }, { id: "link", label: "链接分享" }, { id: "original", label: "仅原创内容" }, ] // 添加关键词 const addKeyword = () => { if (newKeyword.trim() && !formData.keywordFilters.includes(newKeyword.trim())) { setFormData({ ...formData, keywordFilters: [...formData.keywordFilters, newKeyword.trim()], }) setNewKeyword("") } } // 删除关键词 const removeKeyword = (keyword: string) => { setFormData({ ...formData, keywordFilters: formData.keywordFilters.filter((k) => k !== keyword), }) } // 切换内容类型 const toggleContentType = (typeId: string) => { setFormData({ ...formData, contentTypes: formData.contentTypes.includes(typeId) ? formData.contentTypes.filter((id) => id !== typeId) : [...formData.contentTypes, typeId], }) } // 处理表单提交 const handleSubmit = () => { onSave(formData) } return (
点赞配置设置 配置点赞任务的名称、内容和数量 {/* 任务名称 */}
setFormData({ ...formData, taskName: e.target.value })} placeholder="输入任务名称" />
{/* 每日点赞数量 */}
{formData.maxLikesPerDay}个
setFormData({ ...formData, maxLikesPerDay: value[0] })} />
{/* 内容类型设置 */}
{contentTypeOptions.map((type) => (
toggleContentType(type.id)} />
))}
{/* 关键词过滤 */}
setNewKeyword(e.target.value)} className="flex-1" />
{formData.keywordFilters.length > 0 && (
{formData.keywordFilters.map((keyword) => ( {keyword} ))}
)}

添加关键词后,系统将只对包含这些关键词的内容进行点赞

{/* 其他选项 */}

开启后系统将点赞好友的历史朋友圈内容

setFormData({ ...formData, likeOldContent: checked })} />

开启后任务创建完成将立即开始执行

setFormData({ ...formData, startImmediately: checked })} />

开启后系统将只点赞朋友圈第一页的内容

setFormData({ ...formData, likeFirstPageOnly: checked })} />
) }