import { message } from 'antd';

export const useMemberActions = (teamId) => {
  const handleUpdate = (id, values) => {
    // 模拟API调用
    console.log('Update member:', id, values);
    message.success('成员信息已更新');
  };

  const handleDelete = (id) => {
    // 模拟API调用
    console.log('Delete member:', id);
    message.success('成员已删除');
  };

  const handleAdd = (values) => {
    // 模拟API调用
    console.log('Add member:', values);
    message.success('成员已添加');
    return {
      id: Date.now().toString(),
      teamId,
      isCreator: false,
      ...values,
    };
  };

  return {
    handleUpdate,
    handleDelete,
    handleAdd,
  };
};