require('./errorBar.less');
const React = require('react');
const _ = require('lodash');
import Dialog from '../../../components/dialog.jsx';
const DISMISS_BUTTON = ;
const ErrorBar = (props) => {
let hasOpenError = false, hasCloseError = false, hasMatchError = false;
const renderErrors = () => (
{_.map(props.errors, (err, idx) => {
if (err.id === 'OPEN') hasOpenError = true;
if (err.id === 'CLOSE') hasCloseError = true;
if (err.id === 'MISMATCH') hasMatchError = true;
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.
}
);
if (!props.errors.length) return null;
return (
);
};
module.exports = ErrorBar;