import { Card, CardContent, CardHeader, Typography, CardActions, Button } from '@mui/material'; import makeStyles from '@mui/styles/makeStyles'; import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps'; import StyledPegaDxilMyPageWidgetWrapper from './styles'; interface PegaDxilMyPageWidgetProps extends PConnProps { // If any, enter additional props that only exist on this component header?: string; description?: string; datasource?: any; whatsnewlink?: string; } const useStyles = makeStyles(myTheme => ({ root: { marginTop: myTheme.spacing(1), marginBottom: myTheme.spacing(1), borderLeft: '6px solid', borderLeftColor: myTheme.palette.primary.light } })); // Page Widget example is the "App Announcment" // props passed in combination of props from property panel (config.json) and run time props from Constellation export default function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) { const { header = '', description = '', datasource = [], whatsnewlink = '' } = props; let details = []; if (datasource && datasource.source) { details = datasource.source.map(item => { return item.name; }); } const classes = useStyles(); const handleClick = () => { window.open(whatsnewlink); }; return ( {header}} /> {description} {details.map((itm, idx) => { const theKey = `AppAnn-item-${idx}`; return ( - {itm} ); })} ); }