import React from "react"; import { Row, Col, Card, Radio, Button, Space, Typography } from "antd"; import { ReloadOutlined } from "@ant-design/icons"; const { Text } = Typography; interface DeptDistribution { id: string; name: string; count: number; } interface ChartControlsProps { chartView: string; setChartView: (view: string) => void; selectedDept: string | null; resetFilter: () => void; deptDistribution: DeptDistribution[]; } export default function ChartControls({ chartView, setChartView, selectedDept, resetFilter, deptDistribution, }: ChartControlsProps): React.ReactElement { return (
图表控制: setChartView(e.target.value)} optionType="button" buttonStyle="solid" > 全部 饼图 条形图 {selectedDept && ( )} {selectedDept ? `已筛选: ${ deptDistribution.find((d) => d.id === selectedDept) ?.name || "" }` : "点击饼图可筛选部门"}
); }