import Link from 'next/link'
import type { ReactNode } from 'react'
interface EmptyStateAction {
label: string
href?: string
onClick?: () => void
}
interface EmptyStateProps {
/** Emoji string or any custom node (e.g. an SVG icon). */
icon?: ReactNode
title: string
description?: string
action?: EmptyStateAction
}
export default function EmptyState({ icon = '📭', title, description, action }: EmptyStateProps) {
return (
{icon}
{title}
{description && (
{description}
)}
{action &&
}
)
}
function EmptyStateActionButton({ action }: { action: EmptyStateAction }) {
const className =
'inline-flex items-center justify-center rounded-lg bg-[var(--primary)] px-6 py-2.5 font-semibold text-white transition-opacity hover:opacity-90'
if (action.href) {
return (
{action.label}
)
}
return (
)
}
/* ---------------------------------------------------------------------------
* Preset variants for common zero-states.
* ------------------------------------------------------------------------- */
export function EmptyFeed({ action }: { action?: EmptyStateAction }) {
return (
)
}
export function EmptySearch({ query }: { query?: string }) {
return (
)
}
export function EmptyNotifications() {
return (
)
}
export function EmptyMessages({ action }: { action?: EmptyStateAction }) {
return (
)
}
export function EmptyRepos({ action }: { action?: EmptyStateAction }) {
return (
)
}