import React from 'react'; import { Button, Empty } from 'antd'; export interface QueryEmptyAction { label: string; onClick: () => void; type?: 'primary' | 'default'; icon?: React.ReactNode; } export interface QueryEmptyProps { /** 空状态描述,默认「暂无数据」 */ description?: string; /** 主操作按钮(如「添加学生」「导入 Excel」) */ action?: QueryEmptyAction; /** 自定义空态插图 */ image?: React.ReactNode; } /** * 统一空状态:数据确实为空时渲染本组件,并附带主操作按钮引导用户开始。 */ export const QueryEmpty: React.FC = ({ description = '暂无数据', action, image }) => { return ( {action ? ( ) : null} ); }; export default QueryEmpty;