1
0
Fork 0
freesewing/sites/shared/components/workbench/draft/error.js

31 lines
904 B
JavaScript
Raw Normal View History

import DefaultErrorView from 'shared/components/error/view'
2022-01-28 16:57:07 +01:00
const Error = ({ logs=[], updateGist }) => {
let errors = 0
let warnings = 0
for (const log of logs) {
errors += log.errors.length
warnings += log.warnings.length
}
const inspectChildren = (
<ul className="list-disc list-inside ml-4 text-xl">
2022-07-14 07:08:41 -05:00
<li>
Check the{' '}
<button className="btn-link" onClick={() => updateGist(['_state', 'view'], 'logs')}>
<strong>{errors.length} errors</strong> and <strong>{warnings.length} warnings</strong>
</button>
2022-07-14 07:08:41 -05:00
</li>
<li>Check the partially rendered pattern below to see which areas are problematic</li>
</ul>
)
return (
<DefaultErrorView inspectChildren={inspectChildren}>
<p>No need to be alarmed, but we ran into some trouble while drafting this pattern.</p>
</DefaultErrorView>
)
2022-02-08 20:49:19 +01:00
}
2022-01-28 16:57:07 +01:00
export default Error