= ({ cardSummary, color }) => {
return cardSummary.group && !cardSummary.group.billRequest;
};
- const attributeValues = () => {
- return (
-
- {cardSummary.attributes
- .filter(cardAttr => cardAttr.attribute.isShownOnDashboard && cardAttr.value !== null)
- .map(cardAttr => (
-
- {cardAttr.attribute.label}: {getAttrValueValue(cardAttr)}
-
- ))
- }
-
- );
- };
-
- const getAttrValueValue = (cardAttr: CardAttributeSchema) => {
- const value = cardAttr.value;
- if (value === null) return;
-
- const type = cardAttr.attribute.type.type;
- if (type === "datetime") {
- return formatDateTime(value as string);
- }
- if (type === "date") {
- return formatDate(value as string);
- }
- if (type === "bool") {
- return value ? "да" : "нет";
- }
-
- return value;
- };
-
return (
= ({ cardSummary, color }) => {
)}
- {attributeValues()}
+
{!cardSummary.group?.id && (
)}