1- import { lazy , Suspense } from 'react'
2-
31import { useEffect , useState } from 'react'
42import { Link } from '../types/api'
53import { getAllLinks , deleteLink } from '../api/client'
@@ -24,7 +22,7 @@ import {
2422 DialogFooter ,
2523} from "@/components/ui/dialog"
2624
27- const StatisticsModal = lazy ( ( ) => import ( ' ./StatisticsModal' ) )
25+ import { StatisticsModal } from " ./StatisticsModal"
2826
2927interface LinkListProps {
3028 refresh ?: number ;
@@ -87,13 +85,13 @@ export function LinkList({ refresh = 0 }: LinkListProps) {
8785 const baseUrl = window . location . origin
8886 navigator . clipboard . writeText ( `${ baseUrl } /${ shortCode } ` )
8987 toast ( {
90- description : (
91- < >
92- Link copied to clipboard
93- < br />
94- You can add ?source=TextHere to the end of the link to track the source of clicks
95- </ >
96- ) ,
88+ description : (
89+ < >
90+ Link copied to clipboard
91+ < br />
92+ You can add ?source=TextHere to the end of the link to track the source of clicks
93+ </ >
94+ ) ,
9795 } )
9896 }
9997
@@ -188,15 +186,11 @@ export function LinkList({ refresh = 0 }: LinkListProps) {
188186 </ div >
189187 </ CardContent >
190188 </ Card >
191- { statsModal . isOpen && (
192- < Suspense fallback = { < div > Loading...</ div > } >
193- < StatisticsModal
194- isOpen = { statsModal . isOpen }
195- onClose = { ( ) => setStatsModal ( { isOpen : false , linkId : null } ) }
196- linkId = { statsModal . linkId ! }
197- />
198- </ Suspense >
199- ) }
189+ < StatisticsModal
190+ isOpen = { statsModal . isOpen }
191+ onClose = { ( ) => setStatsModal ( { isOpen : false , linkId : null } ) }
192+ linkId = { statsModal . linkId ! }
193+ />
200194 </ >
201195 )
202196}
0 commit comments