Lazy load every instance of using ant icons. Closes #2583
This commit is contained in:
@@ -2,10 +2,16 @@ import { Table, Button } from 'antd';
|
||||
import format from 'date-fns/format';
|
||||
import { SortOrder } from 'antd/lib/table/interface';
|
||||
import React, { FC } from 'react';
|
||||
import { StopTwoTone } from '@ant-design/icons';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { User } from '../../types/chat';
|
||||
import { BANNED_IP_REMOVE, fetchData } from '../../utils/apis';
|
||||
|
||||
// Lazy loaded components
|
||||
|
||||
const StopTwoTone = dynamic(() => import('@ant-design/icons/StopTwoTone'), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
function formatDisplayDate(date: string | Date) {
|
||||
return format(new Date(date), 'MMM d H:mma');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user