import { Copy, Edit, FileText, LayoutTemplate } from 'lucide-react'; import { Button } from 'react-bootstrap'; import { useSelector } from 'react-redux'; import Spinning from './SpinningComponent'; export default function TemplateList({ activeTab, openModal, setFormData }) { const { templates, templatesStatus } = useSelector((state) => state.inbox); // 如果正在加载,显示加载中 if (templatesStatus === 'loading') { return ; } if (templates.length === 0) { return (
No templates found
); } const handleEdit = (template) => { setFormData({ id: template.id, mission: template.type, platform: template.platform, service: template.service, content: template.preview, title: template.title, category: template.category, collaboration_type: template.collaboration_type, is_public: template.is_public, }); openModal(); } return (
{templates.map((template) => (
{template.mission === 'initial_contact' && ( 初步建联 )} {template.mission === 'negotiation' && ( 砍价邮件 )} {template.mission === 'script' && ( 脚本邮件 )} {template.mission === 'follow_up' && ( 合作追踪 )}{' '} - {template.title}
Platform
{template.platform}
Service
{template.service}
Message
{template.preview}
))}
); }