Forráskód Böngészése

feat(report): add close button to diagnostic page

sw 3 hete
szülő
commit
3e11e812ec

+ 17 - 1
src/pages/patient/DiagnosticReport/components/ReportHeader.tsx

@@ -1,5 +1,21 @@
 import React from 'react';
+import { useDispatch } from 'react-redux';
+import { Button } from 'antd';
+import { setVisible } from '@/states/patient/DiagnosticReport/slice';
 
 export const ReportHeader: React.FC = () => {
-  return <div title="报告" />;
+  const dispatch = useDispatch();
+
+  const handleClose = () => {
+    dispatch(setVisible(false));
+  };
+
+  return (
+    <div className="flex justify-between items-center">
+      <span className="text-lg font-semibold">报告</span>
+      <Button type="primary" onClick={handleClose} className="ml-auto">
+        Close
+      </Button>
+    </div>
+  );
 };