Przeglądaj źródła

显示已经复制的句子数量

visuddhinanda 1 rok temu
rodzic
commit
c31697785a

+ 4 - 3
dashboard-v4/dashboard/src/components/channel/CopyToResult.tsx

@@ -1,15 +1,16 @@
 import { Button, Result } from "antd";
 
 interface IWidget {
+  total?: number;
   onClose?: Function;
   onInit?: Function;
 }
-const CopytoResultWidget = ({ onClose, onInit }: IWidget) => {
+const CopyToResult = ({ total, onClose, onInit }: IWidget) => {
   return (
     <Result
       status="success"
       title="Successfully Copied!"
-      subTitle="Sentence: 23 , Words: 143"
+      subTitle={`Sentence: ${total}`}
       extra={[
         <Button
           key="init"
@@ -37,4 +38,4 @@ const CopytoResultWidget = ({ onClose, onInit }: IWidget) => {
   );
 };
 
-export default CopytoResultWidget;
+export default CopyToResult;

+ 4 - 1
dashboard-v4/dashboard/src/components/channel/CopyToStep.tsx

@@ -30,6 +30,7 @@ const CopyToStepWidget = ({
   const [current, setCurrent] = useState(0);
   const [destChannel, setDestChannel] = useState<IChannel>();
   const [copyPercent, setCopyPercent] = useState<number>();
+  const [total, setTotal] = useState<number>();
 
   useEffect(() => {
     setCurrent(initStep);
@@ -83,7 +84,8 @@ const CopyToStepWidget = ({
           goPrev={() => {
             prev();
           }}
-          onSubmit={() => {
+          onSubmit={(total: number) => {
+            setTotal(total);
             next();
           }}
         />
@@ -95,6 +97,7 @@ const CopyToStepWidget = ({
       content: (
         <div style={contentStyle}>
           <CopyToResult
+            total={total}
             onClose={() => {
               if (typeof onClose !== "undefined") {
                 onClose();