feat: add loading spinner to ComicPage component
This commit is contained in:
parent
bd536f2ea5
commit
482892ffc1
1 changed files with 18 additions and 15 deletions
|
@ -8,6 +8,7 @@ import { EnterFullScreenIcon, ExitFullScreenIcon, ExitIcon } from "@radix-ui/rea
|
|||
import { useEventListener } from "usehooks-ts";
|
||||
import type { Document } from "dbtype";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Loader2 } from "lucide-react";
|
||||
|
||||
interface ComicPageProps {
|
||||
params: {
|
||||
|
@ -121,9 +122,11 @@ export default function ComicPage({
|
|||
const [curPage, setCurPage] = useState(0);
|
||||
const { isFullScreen, toggleFullScreen } = useFullScreen();
|
||||
if (isLoading) {
|
||||
// TODO: Add a loading spinner
|
||||
return <div className="p-4">
|
||||
Loading...
|
||||
return <div className="p-4 flex items-center justify-center gap-2 h-dvh">
|
||||
<Loader2
|
||||
className="w-6 h-6 animate-spin text-primary"
|
||||
/>
|
||||
<span className="text-muted-foreground">로딩 중...</span>
|
||||
</div>
|
||||
}
|
||||
if (error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue