visuddhinanda пре 2 година
родитељ
комит
b6fe7dbdd6
1 измењених фајлова са 11 додато и 2 уклоњено
  1. 11 2
      dashboard/src/components/general/TextDiff.tsx

+ 11 - 2
dashboard/src/components/general/TextDiff.tsx

@@ -6,8 +6,13 @@ const { Text } = Typography;
 interface IWidget {
 interface IWidget {
   content?: string | null;
   content?: string | null;
   oldContent?: string | null;
   oldContent?: string | null;
+  showToolTip?: boolean;
 }
 }
-const TextDiffWidget = ({ content, oldContent }: IWidget) => {
+const TextDiffWidget = ({
+  content,
+  oldContent,
+  showToolTip = true,
+}: IWidget) => {
   if (content) {
   if (content) {
     if (oldContent) {
     if (oldContent) {
       const diff: Change[] = diffChars(oldContent, content);
       const diff: Change[] = diffChars(oldContent, content);
@@ -24,7 +29,11 @@ const TextDiffWidget = ({ content, oldContent }: IWidget) => {
           </Text>
           </Text>
         );
         );
       });
       });
-      return <Tooltip title={content}>{diffResult}</Tooltip>;
+      return showToolTip ? (
+        <Tooltip title={content}>{diffResult}</Tooltip>
+      ) : (
+        <> {diffResult}</>
+      );
     } else {
     } else {
       return <Text>{content}</Text>;
       return <Text>{content}</Text>;
     }
     }