Updates screenshot component

This commit is contained in:
Alicia Sykes
2023-07-22 00:05:38 +01:00
parent 13bea91b60
commit 463e5d7154
3 changed files with 20 additions and 5 deletions

View File

@ -11,11 +11,12 @@ const cardStyles = `
}
`;
const ScreenshotCard = (props: { data: { data: string }, title: string, actionButtons: any }): JSX.Element => {
const ScreenshotCard = (props: { data: { image?: string, data?: string, }, title: string, actionButtons: any }): JSX.Element => {
const screenshot = props.data;
return (
<Card heading={props.title} actionButtons={props.actionButtons} styles={cardStyles}>
<img src={screenshot.data} alt="Full page screenshot" />
{ screenshot.image && <img src={`data:image/png;base64,${screenshot.image}`} alt="Full page screenshot" /> }
{ (!screenshot.image && screenshot.data) && <img src={screenshot.data} alt="Full page screenshot" /> }
</Card>
);
}