UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

94 lines (92 loc) 2.41 kB
import { Text_default } from "./chunk-IMCIR6TJ.mjs"; import { cn } from "./chunk-53ICLDGS.mjs"; // src/components/shared/StatCard/StatCard.tsx import { StarIcon } from "@phosphor-icons/react/dist/csr/Star"; import { MedalIcon } from "@phosphor-icons/react/dist/csr/Medal"; import { WarningCircleIcon } from "@phosphor-icons/react/dist/csr/WarningCircle"; import { InfoIcon } from "@phosphor-icons/react/dist/csr/Info"; import { jsx, jsxs } from "react/jsx-runtime"; var variantConfig = { score: { bg: "bg-warning-background", text: "text-warning-600", iconBg: "bg-warning-300", iconColor: "text-white", IconComponent: StarIcon }, correct: { bg: "bg-success-200", text: "text-success-700", iconBg: "bg-indicator-positive", iconColor: "text-text-950", IconComponent: MedalIcon }, incorrect: { bg: "bg-error-100", text: "text-error-700", iconBg: "bg-indicator-negative", iconColor: "text-white", IconComponent: WarningCircleIcon }, blank: { bg: "bg-info", text: "text-info-800", iconBg: "bg-indicator-info", iconColor: "text-white", IconComponent: InfoIcon } }; var StatCard = ({ label, value, variant, className }) => { const config = variantConfig[variant]; const IconComponent = config.IconComponent; return /* @__PURE__ */ jsxs( "div", { className: cn( "border border-border-50 rounded-xl py-4 px-3 flex flex-col items-center justify-center gap-1", config.bg, className ), children: [ /* @__PURE__ */ jsx( "div", { className: cn( "w-[30px] h-[30px] rounded-2xl flex items-center justify-center", config.iconBg ), children: /* @__PURE__ */ jsx( IconComponent, { size: 16, className: config.iconColor, weight: "regular" } ) } ), /* @__PURE__ */ jsx( Text_default, { className: cn("text-2xs font-bold uppercase text-center", config.text), children: label } ), /* @__PURE__ */ jsx(Text_default, { className: cn("text-xl font-bold", config.text), children: value }) ] } ); }; export { StatCard }; //# sourceMappingURL=chunk-3ZYHNRVG.mjs.map