analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
64 lines (62 loc) • 2.45 kB
JavaScript
import {
Button_default
} from "./chunk-LAYB7IKW.mjs";
import {
Text_default
} from "./chunk-IMCIR6TJ.mjs";
// src/components/EmptyState/EmptyState.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var EmptyState = ({
image,
title,
description,
buttonText,
buttonIcon,
onButtonClick,
buttonVariant = "solid",
buttonAction = "primary",
size = "large"
}) => {
const displayTitle = title || "Nenhum dado dispon\xEDvel";
const displayDescription = description || "N\xE3o h\xE1 dados para exibir no momento.";
const titleClassName = size === "compact" ? "text-text-600 text-sm font-semibold text-center" : "text-text-950 text-3xl font-semibold text-center";
const descriptionClassName = size === "compact" ? "text-text-600 text-sm font-normal text-center" : "text-text-600 text-[18px] font-normal text-center";
const containerMinHeight = size === "compact" ? "min-h-0" : "min-h-[705px]";
return /* @__PURE__ */ jsxs(
"div",
{
className: `flex flex-col justify-center items-center gap-6 w-full ${containerMinHeight} bg-background rounded-xl p-6`,
children: [
image && /* @__PURE__ */ jsx("div", { className: "max-w-[170px] max-h-[150px] flex items-center justify-center", children: typeof image === "string" ? /* @__PURE__ */ jsx(
"img",
{
src: image,
alt: displayTitle,
className: "w-full h-full max-w-[170px] max-h-[150px]"
}
) : /* @__PURE__ */ jsx("div", { className: "w-[170px] h-[150px] flex items-center justify-center", children: image }) }),
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 w-full max-w-[600px] px-6", children: [
/* @__PURE__ */ jsx(Text_default, { as: "h2", className: titleClassName, children: displayTitle }),
/* @__PURE__ */ jsx(Text_default, { className: descriptionClassName, children: displayDescription })
] }),
buttonText && onButtonClick && /* @__PURE__ */ jsx(
Button_default,
{
variant: buttonVariant,
action: buttonAction,
size: "large",
onClick: onButtonClick,
iconLeft: buttonIcon,
className: "rounded-full px-5 py-2.5",
children: buttonText
}
)
]
}
);
};
var EmptyState_default = EmptyState;
export {
EmptyState_default
};
//# sourceMappingURL=chunk-6WVHF7N3.mjs.map