import type { ProColumns } from '@ant-design/pro-components';
import { Badge, Button, Image, Space, Typography } from 'antd';
import dayjs from 'dayjs';
import type { Prod } from '@/services/prod/prod-manager';

const { Text } = Typography;
export const baseTenantColumns: ProColumns<Prod>[] = [
  {
    title: '商品',
    dataIndex: 'prodName',
    render: (_, record) => (
      <Space>
        <Image width={64} height={64} src={record.pic} />
        <div>
          <div>
            <Text>{record.categoryName}</Text>
          </div>
          <div>
            <Text type="secondary">ID：{record.categoryName}</Text>
          </div>
          <div>
            <Text type="secondary">类目：{record.categoryName}</Text>
          </div>
        </div>
      </Space>
    ),
  },
  {
    title: '服务信息',
    dataIndex: 'categoryId',
    render: () => (
      <Space direction="vertical">
        <div>
          <Text type="secondary">服务区域：</Text>
          <Text></Text>
        </div>
        <div>
          <Text type="secondary">服务区域：</Text>
          <Text></Text>
        </div>
        <div>
          <Text type="secondary">紧急服务：</Text>
          <Text></Text>
        </div>
      </Space>
    ),
  },

  {
    title: '状态',
    dataIndex: 'status',
    valueType: 'switch',
    width: 300,
    hideInSearch: true,
    render: () => (
      <Space direction="vertical">
        <Space>
          <Badge status="success" text="出售中" />
          <Badge status="default" text="已置灰" />
          <Badge status="warning" text="待审核" />
          <Badge status="default" text="仓库中" />
        </Space>
        <Button size="small" type="dashed">
          状态控制
        </Button>
      </Space>
    ),
  },
  {
    title: '时间信息',
    dataIndex: 'createTime',
    valueType: 'dateRange',
    hideInSearch: true, // 在搜索表单中隐藏
    render: (_, record) => (
      <Space direction="vertical">
        <div>
          <Image></Image> 某某某某有限公司
        </div>
        <div>
          <Text type="secondary">创建时间：</Text>
          {dayjs(record.createTime).format('YYYY-MM-DD HH:mm:ss')}
        </div>
        <div>
          <Text type="secondary">更新时间：</Text>
          {dayjs(record.updateTime).format('YYYY-MM-DD HH:mm:ss')}
        </div>
      </Space>
    ),
  },
];
