require('./errorBar.less');
const React = require('react');
import Dialog from '../../../components/dialog.jsx';
const DISMISS_BUTTON = ;
const ErrorBar = (props)=>{
if(!props.errors.length) return null;
let hasOpenError = false, hasCloseError = false, hasMatchError = false;
props.errors.map((err)=>{
if(err.id === 'OPEN') hasOpenError = true;
if(err.id === 'CLOSE') hasCloseError = true;
if(err.id === 'MISMATCH') hasMatchError = true;
});
const renderErrors = ()=>(
{props.errors.map((err, idx)=>{
return -
Line {err.line} : {err.text}, '{err.type}' tag
;
})}
);
const renderProtip = ()=>(
Protips!
{hasOpenError &&
Unmatched opening tag. Close your tags, like this {'
'}. Match types!
}
{hasCloseError && Unmatched closing tag. Either remove it or check where it was opened.
}
{hasMatchError && Type mismatch. Closed a tag with a different type.
}
);
return (
);
};
module.exports = ErrorBar;