Module Update
Some checks failed
CI / build-and-test (push) Failing after 1m31s
CI / deploy (push) Has been skipped

This commit is contained in:
SpecialX
2025-12-30 14:42:30 +08:00
parent f1797265b2
commit e7c902e8e1
148 changed files with 19317 additions and 113 deletions

View File

@@ -0,0 +1,59 @@
import * as React from "react"
import Link from "next/link"
import { cn } from "@/shared/lib/utils"
import { Button } from "@/shared/components/ui/button"
interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
title: string
description: string
icon?: React.ElementType
action?: {
label: string
onClick?: () => void
href?: string
}
}
export function EmptyState({
icon: Icon,
title,
description,
action,
className,
...props
}: EmptyStateProps) {
return (
<div
className={cn(
"flex h-[450px] shrink-0 items-center justify-center rounded-md border border-dashed",
className
)}
{...props}
>
<div className="mx-auto flex max-w-[420px] flex-col items-center justify-center text-center">
{Icon && (
<div className="flex h-20 w-20 items-center justify-center rounded-full bg-muted">
<Icon className="h-10 w-10 text-muted-foreground" />
</div>
)}
<h3 className="mt-4 text-lg font-semibold">{title}</h3>
{description && (
<p className="mb-4 mt-2 text-sm text-muted-foreground">
{description}
</p>
)}
{action && (
action.href ? (
<Button asChild variant="default">
<Link href={action.href}>{action.label}</Link>
</Button>
) : (
<Button onClick={action.onClick} variant="default">
{action.label}
</Button>
)
)}
</div>
</div>
)
}