"use client";
import { __rest } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
import { jsxs, jsx } from 'react/jsx-runtime';
import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
import { cn } from '@windrun-huaiin/lib/utils';
import Link from 'next/link';

function ZiaCard(_a) {
    var { icon, title, description } = _a, props = __rest(_a, ["icon", "title", "description"]);
    const validHref = typeof props.href === 'string' && props.href.trim() !== '';
    const validDescription = typeof description === 'string' && (description === null || description === void 0 ? void 0 : description.trim()) !== '';
    if (validHref) {
        return (jsxs(Link, Object.assign({ href: props.href, "data-card": true, className: cn('block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full', 'hover:bg-fd-accent/80', props.className) }, props, { children: [jsx("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : jsx(globalLucideIcons.CircleSmall, {}) }), jsx("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-10", children: title }), validDescription ? (jsx("p", { className: "my-0! text-sm text-fd-muted-foreground", children: description })) : (jsx("p", { className: "my-0! text-sm text-fd-muted-foreground opacity-0 select-none", children: "\u00A0" })), props.children ? (jsx("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children })) : null] })));
    }
    return (jsxs("div", Object.assign({ "data-card": true, className: cn('block rounded-lg border bg-fd-card p-4 text-fd-card-foreground shadow-md transition-colors @max-lg:col-span-full', props.className) }, props, { children: [jsx("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : jsx(globalLucideIcons.CircleSmall, {}) }), jsx("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-10", children: title }), validDescription ? (jsx("p", { className: "my-0! text-sm text-fd-muted-foreground", children: description })) : (jsx("p", { className: "my-0! text-sm text-fd-muted-foreground opacity-0 select-none", children: "\u00A0" })), props.children ? (jsx("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children })) : null] })));
}

export { ZiaCard };
