import React, { useCallback } from 'react' import styles from './index.module.scss' import { Button, Modal } from 'antd' import { MessageFu } from '@/utils/message' export type A2TcanType = { time: string num: null | 0 | 1 } type Props = { info: A2TcanType closeFu: (val: 0 | 1 | null) => void } const arr = [ { name: '不可预约', num: 1 }, { name: '可预约', num: 0 } ] function A2timeFlag({ info, closeFu }: Props) { const btnClick = useCallback( (val: number) => { if (val === info.num) return MessageFu.info(`当前已经是${info.num ? '' : '不'}可预约状态!`) closeFu(val as 0) }, [closeFu, info.num] ) return ( closeFu(null)} footer={ [] // 设置footer为空,去掉 取消 确定默认按钮 } > {info.num !== null ? (
{info.time}:  {arr.map(v => ( ))}
) : null}
) } const MemoA2timeFlag = React.memo(A2timeFlag) export default MemoA2timeFlag