UNPKG

analytica-frontend-lib

Version:

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

94 lines (87 loc) 2.8 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _chunkANT66KVKjs = require('./chunk-ANT66KVK.js'); var _chunkTN3AYOMVjs = require('./chunk-TN3AYOMV.js'); // src/components/shared/StatCard/StatCard.tsx var _Star = require('@phosphor-icons/react/dist/csr/Star'); var _Medal = require('@phosphor-icons/react/dist/csr/Medal'); var _WarningCircle = require('@phosphor-icons/react/dist/csr/WarningCircle'); var _Info = require('@phosphor-icons/react/dist/csr/Info'); var _jsxruntime = require('react/jsx-runtime'); var variantConfig = { score: { bg: "bg-warning-background", text: "text-warning-600", iconBg: "bg-warning-300", iconColor: "text-white", IconComponent: _Star.StarIcon }, correct: { bg: "bg-success-200", text: "text-success-700", iconBg: "bg-indicator-positive", iconColor: "text-text-950", IconComponent: _Medal.MedalIcon }, incorrect: { bg: "bg-error-100", text: "text-error-700", iconBg: "bg-indicator-negative", iconColor: "text-white", IconComponent: _WarningCircle.WarningCircleIcon }, blank: { bg: "bg-info", text: "text-info-800", iconBg: "bg-indicator-info", iconColor: "text-white", IconComponent: _Info.InfoIcon } }; var StatCard = ({ label, value, variant, className }) => { const config = variantConfig[variant]; const IconComponent = config.IconComponent; return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkTN3AYOMVjs.cn.call(void 0, "border border-border-50 rounded-xl py-4 px-3 flex flex-col items-center justify-center gap-1", config.bg, className ), children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkTN3AYOMVjs.cn.call(void 0, "w-[30px] h-[30px] rounded-2xl flex items-center justify-center", config.iconBg ), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, IconComponent, { size: 16, className: config.iconColor, weight: "regular" } ) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { className: _chunkTN3AYOMVjs.cn.call(void 0, "text-2xs font-bold uppercase text-center", config.text), children: label } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { className: _chunkTN3AYOMVjs.cn.call(void 0, "text-xl font-bold", config.text), children: value }) ] } ); }; exports.StatCard = StatCard; //# sourceMappingURL=chunk-XOJ3ERAL.js.map