import {
CopyOutlined,
DeleteOutlined,
MailOutlined,
PlusOutlined,
TeamOutlined,
UserOutlined,
} from '@ant-design/icons';
import { Card, Button, List, Tag, Space, Popconfirm, App as AntApp, Modal, Form, Input, Empty } from 'antd';
import { TeamAPI, type Team } from '../../../api';
import type { TeamsPageLogicOutput } from '../TeamsPageLogic';
interface Props {
logic: TeamsPageLogicOutput;
}
export default function TeamsPageWeb({ logic }: Props) {
const { message } = AntApp.useApp();
const {
list,
active,
handleDelete,
handleRemoveMember,
setCreateOpen,
} = logic;
return (
协作组织空间
团队管理
团队不只是成员列表,更是共享智能体、协同运营和权限分工的组织单元。这里统一查看团队、成员和邀请状态。
} onClick={() => setCreateOpen(true)} style={{ borderRadius: 14, height: 46, padding: '0 18px', fontWeight: 600 }}>
创建团队
{[
{ label: '团队数量', value: list.length, tone: 'rgba(8, 145, 178, 0.10)', color: 'var(--color-brand)' },
{ label: '当前成员数', value: active?.members?.length ?? 0, tone: 'rgba(14, 165, 233, 0.10)', color: 'var(--color-info)' },
{ label: '共享智能体', value: active?.agentCount ?? 0, tone: 'rgba(34, 197, 94, 0.10)', color: 'var(--color-success)' },
].map((item) => (
{item.label}
{item.value}
当前选中
))}
{list.length === 0 ? (
) : (
(
{
logic.setActive(await TeamAPI.detail(item.id));
}}
style={{
padding: '10px 12px',
borderRadius: 14,
cursor: 'pointer',
marginBottom: 6,
background: active?.id === item.id ? 'rgba(8, 145, 178, 0.10)' : 'transparent',
color: active?.id === item.id ? 'var(--color-brand)' : 'var(--color-text-secondary)',
fontWeight: active?.id === item.id ? 600 : 500,
border: active?.id === item.id ? '1px solid rgba(8, 145, 178, 0.16)' : '1px solid transparent',
}}
>
{item.name}
{item.agentCount ?? 0} 个智能体
)}
/>
)}
{active ? (
{active.name}
{active.myRole}
{active.agentCount ?? 0} 智能体
管理成员权限、邀请新伙伴,并协同维护团队共享的智能体资产。
{(active.myRole === 'owner' || active.myRole === 'admin') && (
} onClick={() => logic.setInviteOpen(true)} style={{ borderRadius: 12 }}>
生成邀请码
)}
{active.myRole === 'owner' && (
{
await handleDelete(active.id);
message.success('已删除');
}}
>
} style={{ borderRadius: 12 }}>
删除团队
)}
成员规模
{active.members?.length || 0}
共享智能体
{active.agentCount ?? 0}
成员 ({active.members?.length || 0})
(
{
await handleRemoveMember(m.id);
}}
>
,
]
: []
}
>
}
title={
{m.name}
{m.role}
}
description={
{m.email}
加入时间 {new Date(m.joinedAt).toLocaleDateString('zh-CN')}
}
/>
)}
/>
) : (
)}
logic.setCreateOpen(false)}
footer={null}
destroyOnHidden
>
{
logic.setInviteOpen(false);
logic.setLastInviteCode(null);
}}
footer={null}
destroyOnHidden
>
{logic.lastInviteCode ? (
邀请码生成成功,请发给受邀者:
}
style={{ marginTop: 12, borderRadius: 10 }}
onClick={() => {
navigator.clipboard?.writeText(logic.lastInviteCode || '').then(() => message.success('邀请码已复制'));
}}
>
复制邀请码
受邀者在注册页填入此邀请码即可加入团队
) : (
)}
);
}