log-viewer/frontend/src/components/event/Event.js

24 lines
549 B
JavaScript

import React from "react";
import "./Event.css";
function Event(props) {
let imgArray = [];
if (props.data.hasOwnProperty('screenshots')) {
props.data.screenshots.forEach(element => {
imgArray = [...imgArray, (<a href={element.orig} target="_blank"><img src={element.url} className="eventPic"></img></a>)]
});
}
return (
<div className="eventDiv">
{JSON.stringify(props.data.source)}
<br></br>
{[...imgArray]}
</div>
);
}
export default Event;