Lazy load tooltip

This commit is contained in:
Gabe Kangas
2023-01-09 16:09:13 -08:00
parent bd3c81c353
commit 29882f1291
7 changed files with 46 additions and 32 deletions

View File

@@ -1,17 +1,22 @@
// Custom component for AntDesign Button that makes an api call, then displays a confirmation icon upon
import React, { useState, useEffect, FC } from 'react';
import { Button, Tooltip } from 'antd';
import { Button } from 'antd';
import {
EyeOutlined,
EyeInvisibleOutlined,
CheckCircleFilled,
ExclamationCircleFilled,
} from '@ant-design/icons';
import dynamic from 'next/dynamic';
import { fetchData, UPDATE_CHAT_MESSGAE_VIZ } from '../utils/apis';
import { MessageType } from '../types/chat';
import { OUTCOME_TIMEOUT } from '../pages/admin/chat/messages';
import { isEmptyObject } from '../utils/format';
// Lazy loaded components
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
export type MessageToggleProps = {
isVisible: boolean;
message: MessageType;