"use client"; import { Button } from "@app/components/ui/button"; import { cn } from "@app/lib/cn"; import { LayoutGrid, SearchX } from "lucide-react"; import { useTranslations } from "next-intl"; type LauncherEmptyStateVariant = "empty" | "noResults"; type LauncherEmptyStateProps = { variant: LauncherEmptyStateVariant; layout: "grid" | "list"; query?: string; onClearFilters?: () => void; }; function GhostResourceGrid() { return (
{Array.from({ length: 4 }).map((_, index) => (
))}
); } function GhostResourceList() { return (
{Array.from({ length: 3 }).map((_, index) => (
))}
); } export function LauncherEmptyState({ variant, layout, query, onClearFilters }: LauncherEmptyStateProps) { const t = useTranslations(); const isNoResults = variant === "noResults"; const Icon = isNoResults ? SearchX : LayoutGrid; const trimmedQuery = query?.trim(); return (
{layout === "grid" ? ( ) : ( )}

{isNoResults ? t("resourceLauncherEmptyStateNoResultsTitle") : t("resourceLauncherEmptyStateTitle")}

{isNoResults ? trimmedQuery ? t( "resourceLauncherEmptyStateNoResultsWithQuery", { query: trimmedQuery } ) : t( "resourceLauncherEmptyStateNoResultsDescription" ) : t("resourceLauncherEmptyStateDescription")}

{isNoResults && onClearFilters ? ( ) : null}
); }