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.content, title: template.title, category: template.category, collaboration_type: template.collaboration_type, is_public: template.is_public, }); openModal(); } return (
{templates.map((template) => (
{template.type === 'initial' && ( 初步建联 )} {template.type === 'bargain' && ( 砍价邮件 )} {template.type === 'script' && ( 脚本邮件 )} {template.type === 'cooperation' && ( 合作追踪 )}{' '} - {template.name}
Platform
{template.platform}
Service
{template.service}
Message
{template.message}
))}
); }