added footer html to tables

This commit is contained in:
Tim Chamberlain
2023-04-19 12:12:58 -05:00
parent eca6c5c8b3
commit 05c92921d4
3 changed files with 10 additions and 2 deletions

View File

@ -225,6 +225,7 @@ function DashboardWidgets({widgetMetaDataList, tableName, entityPrimaryKey, omit
widgetMetaData={widgetMetaData}
widgetData={widgetData[i]}
reloadWidgetCallback={(data) => reloadWidget(i, data)}
footerHTML={widgetData[i]?.footerHTML}
isChild={areChildren}
>
<TableCard

View File

@ -26,7 +26,8 @@ import Button from "@mui/material/Button";
import Card from "@mui/material/Card";
import Icon from "@mui/material/Icon";
import Typography from "@mui/material/Typography";
import React, {useEffect, useState} from "react";
import parse from "html-react-parser";
import React, {useState} from "react";
import {Link, useNavigate} from "react-router-dom";
import colors from "qqq/components/legacy/colors";
import DropdownMenu, {DropdownOption} from "qqq/components/widgets/components/DropdownMenu";
@ -54,6 +55,7 @@ interface Props
children: JSX.Element;
reloadWidgetCallback?: (params: string) => void;
isChild?: boolean;
footerHTML?: string;
storeDropdownSelections?: boolean;
}
@ -398,6 +400,11 @@ function Widget(props: React.PropsWithChildren<Props>): JSX.Element
)
)
}
{
props?.footerHTML && (
<Box mt={1} ml={3} mr={3} mb={2} sx={{fontWeight: 300, color: "#7b809a", display: "flex", alignContent: "flex-end", fontSize: "14px"}}>{parse(props.footerHTML)}</Box>
)
}
</Box>;
return props.widgetMetaData?.isCard ? <Card sx={{marginTop: props.widgetMetaData?.icon ? 2 : 0, width: "100%"}} className={fullScreenWidgetClassName}>{widgetContent}</Card> : widgetContent;