diff --git a/src/components/DisplayBox/DisplayBox.jsx b/src/components/DisplayBox/DisplayBox.jsx index a8d9265..04b37a9 100644 --- a/src/components/DisplayBox/DisplayBox.jsx +++ b/src/components/DisplayBox/DisplayBox.jsx @@ -1,11 +1,19 @@ import React, { useEffect, useState } from 'react'; import './card-list.css'; -import { Button, Card, CardActions, CardContent, Typography } from '@mui/material'; +import { Button, Box, Card, CardActions, CardContent, Typography } from '@mui/material'; import axios from 'axios'; import ReactMarkdown from 'react-markdown'; import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf'; import { retrieveLaunchContext } from '../../util/util'; import './displayBox.css'; +import ArrowForwardRoundedIcon from '@mui/icons-material/ArrowForwardRounded'; +import Accordion from '@mui/material/Accordion'; +import AccordionSummary from '@mui/material/AccordionSummary'; +import AccordionDetails from '@mui/material/AccordionDetails'; +import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import AddCircleOutlineRoundedIcon from '@mui/icons-material/AddCircleOutlineRounded'; const DisplayBox = props => { const [state, setState] = useState({ smartLink: '', response: {} }); @@ -54,6 +62,7 @@ const DisplayBox = props => { const element = document.getElementById(buttonId); element.setAttribute('disabled', 'true'); element.setAttribute('style', 'background-color:#4BB543;'); + element.setAttribute('style'); } if (suggestion.label) { @@ -182,7 +191,7 @@ const DisplayBox = props => { } if (!isDemoCard) { return ( -
+
Source:{' '} { card.suggestions.forEach((item, ind) => { var buttonId = 'suggestion_button-' + cardInd + '-' + ind; buttonList.push(buttonId); - suggestionsSection.push( - + + + ); }); } // -- Links -- - let linksSection; + let linksSection = []; if (card.links) { card.links = modifySmartLaunchUrls(card) || card.links; - linksSection = card.links.map((link, ind) => { + card.links.map((link, ind) => { if (link.type === 'smart') { - return ( - + linksSection.push( + + + + ); + } + }); + } + + let documentationSection = []; + const pdfIcon = ; + if (card.links) { + card.links = modifySmartLaunchUrls(card) || card.links; + card.links.map((link, ind) => { + if (link.type === 'absolute') { + documentationSection.push( + + + + + ); } - const pdfIcon = ; - return ( - - ); }); } const cardSectionHeaderStyle = { marginBottom: '2px', color: 'black' }; const builtCard = ( - - - - - Summary - - - {summarySection} - -
- - Details - - {detailSection} -
- - {sourceSection} - -
- {linksSection} - {suggestionsSection} -
+ + + + + + {summarySection} + + + {/* Forms */} + {linksSection.length !== 0 ? ( +
+ Required Forms + {detailSection} + {linksSection} +
+ ) : ( + <> + )} + + {/* Suggestions */} + {suggestionsSection.length !== 0 ? ( +
+ + Suggestions + + {suggestionsSection} +
+ ) : ( + <> + )} + + {/* Documentation and Guides */} + {documentationSection.length !== 0 ? ( + + }> + + View documentation and guides + + + + {documentationSection} + + + ) : ( + <> + )} + + + {sourceSection} + +
+
+
);