I'm sure this is something silly, I'm barely awake and my brain doesn't seem to operate on the right level.
I'm working in react and I'm trying to make this switch statement work but it popups up with the following error: Expected an assignment or function call and instead saw an expression (Line 30 - I'll highlight where that line is). I need to have an iframe popup but it doesn't seem to work. I tried making a function and calling that function instead, still same error.
const HandleOnClick = example => {
if (example ) {
if (example.assets.length > 10) {
//Not implemented yet
} else {
switch (example.assets[0].type) {
case "link":
window.open(example.assets[0].url);
break;
case "document":
<iframe src={example.assets[0].url} title="title"> //THIS IS LINE 30 WHERE IT BREAKS
</iframe>
break;
case "video":
//Not implemented
break;
default:
break;
}
}
} else {
................