refactor(layout): replace Card component with Loader2Icon for loading state
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import type { CSSProperties, ReactNode } from "react"
|
import { Loader2Icon } from "lucide-react"
|
||||||
import { useRouter } from "next/navigation"
|
import { useRouter } from "next/navigation"
|
||||||
|
import type { CSSProperties, ReactNode } from "react"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
|
|
||||||
import { AppSidebar } from "@/components/app-sidebar"
|
import { AppSidebar } from "@/components/app-sidebar"
|
||||||
import { useAuth } from "@/components/auth-provider"
|
import { useAuth } from "@/components/auth-provider"
|
||||||
import { SiteHeader } from "@/components/site-header"
|
import { SiteHeader } from "@/components/site-header"
|
||||||
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"
|
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"
|
||||||
import { Card, CardContent } from "@/components/ui/card"
|
|
||||||
|
|
||||||
export default function DashboardLayout({
|
export default function DashboardLayout({
|
||||||
children,
|
children,
|
||||||
@@ -27,17 +27,17 @@ export default function DashboardLayout({
|
|||||||
if (!ready || !session) {
|
if (!ready || !session) {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen items-center justify-center bg-[linear-gradient(160deg,#f3f4f6_0%,#fff7ed_45%,#ecfeff_100%)] p-6">
|
<div className="flex min-h-screen items-center justify-center bg-[linear-gradient(160deg,#f3f4f6_0%,#fff7ed_45%,#ecfeff_100%)] p-6">
|
||||||
<Card className="w-full max-w-md border-0 bg-white/90 shadow-xl shadow-slate-200/60 backdrop-blur">
|
<div className="flex items-center gap-3">
|
||||||
<CardContent className="flex flex-col items-center gap-3 py-12 text-center">
|
<div className="flex size-10 items-center justify-center rounded-full bg-primary/10 text-primary">
|
||||||
<div className="size-10 animate-pulse rounded-full bg-primary/10" />
|
<Loader2Icon className="size-5 animate-spin" />
|
||||||
<div className="space-y-1">
|
</div>
|
||||||
<p className="text-base font-medium">正在校验后台登录态</p>
|
<div className="space-y-1">
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-base font-medium">正在校验登录态</p>
|
||||||
将自动同步当前管理员信息与权限数据
|
<p className="text-sm text-muted-foreground">
|
||||||
</p>
|
将自动同步当前管理员信息与权限数据
|
||||||
</div>
|
</p>
|
||||||
</CardContent>
|
</div>
|
||||||
</Card>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user