Code: Select all
import { ScrollPanel } from 'primereact/scrollpanel';
import { Button } from 'primereact/button'
export default function Output(props) {
const handleClick = () => {
props.setLogs([])
}
return (
<div className="terminal">
<ScrollPanel style={{width: '100%', height: '100%'}} >
logs:
{
props.logs.length>0 &&
props.logs.map( e =>
<p> { e }</p>
)
}
</ScrollPanel>
<br />
<Button onClick={handleClick}>Clear</Button>
</div>
);
}