@coko/client
Version:
Client side common code for coko apps
47 lines (46 loc) • 1.62 kB
JavaScript
import { grid as e, th as t } from "../../toolkit/themeHelper.js";
import "../../toolkit/index.js";
import "react";
import n from "styled-components";
import { jsx as r } from "react/jsx-runtime";
//#region src/ui/common/InviteStatus.tsx
var i = {
success: ["success", "accept"],
error: ["error", "reject"],
warning: [
"warn",
"warning",
"revise"
],
primary: ["primary", "publish"]
}, a = n.span`
background: ${(e) => {
let { $reverseColors: n, $status: r } = e;
return n ? r && i.success.includes(r) ? t("colorSuccess") : r && i.error.includes(r) ? t("colorError") : r && i.warning.includes(r) ? t("colorWarning") : r && i.primary.includes(r) ? t("colorPrimary") : t("colorSecondary") : null;
}};
border-radius: 3px;
color: ${(e) => {
let { $reverseColors: n, $status: r } = e;
return n ? t("colorTextReverse") : r && i.success.includes(r) ? t("colorSuccess") : r && i.error.includes(r) ? t("colorError") : r && i.warning.includes(r) ? t("colorWarning") : r && i.primary.includes(r) ? t("colorPrimary") : t("colorText");
}};
display: flex;
font-family: ${t("fontInterface")};
font-size: ${t("fontSizeBaseSmall")};
justify-content: space-around;
line-height: ${t("lineHeightBaseSmall")};
max-width: ${e(24)};
min-width: ${e(12)};
padding: ${(e) => e.$reverseColors && "4px 8px"};
text-transform: uppercase;
white-space: normal;
`, o = (e) => {
let { children: t, className: n, reverseColors: i = !1, status: o = null } = e;
return t ? /* @__PURE__ */ r(a, {
$reverseColors: i,
$status: o,
className: n,
children: t
}) : null;
};
//#endregion
export { o as default };