"use client" import { useState } from "react" import { ChevronLeft, Plus } from "lucide-react" import { Card } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Badge } from "@/components/ui/badge" import { useRouter } from "next/navigation" // 获取渠道中文名称 const getChannelName = (channel: string) => { const channelMap: Record = { douyin: "抖音", kuaishou: "快手", xiaohongshu: "小红书", weibo: "微博", } return channelMap[channel] || channel } interface Customer { id: string nickname: string avatar: string tags: string[] acquiredTime: string source: string } export default function AcquiredCustomersPage({ params }: { params: { channel: string } }) { const router = useRouter() const channelName = getChannelName(params.channel) const [customers] = useState( Array.from({ length: 31 }, (_, i) => ({ id: `customer-${i + 1}`, nickname: `用户${i + 1}`, avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=" + (i + 1), tags: ["直播间", "高互动", Math.random() > 0.5 ? "潜在客户" : "意向客户"], acquiredTime: new Date(Date.now() - Math.random() * 86400000 * 7).toLocaleString(), source: Math.random() > 0.5 ? "直播间" : "评论区", })), ) const [currentPage, setCurrentPage] = useState(1) const itemsPerPage = 10 const totalPages = Math.ceil(customers.length / itemsPerPage) const currentCustomers = customers.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) return (

{channelName}已获客

{currentCustomers.map((customer) => (
{customer.nickname}

{customer.nickname}

{customer.acquiredTime}
{customer.tags.map((tag, index) => ( {tag} ))}
来源:{customer.source}
))} {totalPages > 1 && (
第 {currentPage} / {totalPages} 页
)}
) }