2022-03-24 10:53:57 +01:00
|
|
|
import { useState } from 'react'
|
2022-01-28 16:57:07 +01:00
|
|
|
import Robot from 'shared/components/robot/index.js'
|
2022-03-24 10:53:57 +01:00
|
|
|
import Popout from 'shared/components/popout.js'
|
2022-02-08 20:49:19 +01:00
|
|
|
import { useTranslation } from 'next-i18next'
|
2022-07-14 07:08:41 -05:00
|
|
|
import DefaultErrorView from 'shared/components/error/view';
|
2022-01-28 16:57:07 +01:00
|
|
|
|
2022-03-24 10:53:57 +01:00
|
|
|
const Error = ({ draft, patternProps, error, updateGist }) => {
|
2022-07-14 07:08:41 -05:00
|
|
|
const inspectChildren = (<ul className="list-disc list-inside ml-4 text-xl">
|
|
|
|
<li>
|
|
|
|
Check the <button className="btn-link" onClick={() => updateGist(['_state', 'view'], 'events')}>
|
|
|
|
<strong>{patternProps?.events?.error?.length} errors</strong> and <strong>
|
|
|
|
{patternProps?.events?.warning?.length} warnings</strong></button>
|
|
|
|
</li>
|
|
|
|
<li>Check the partially rendered pattern below to see which areas are problematic</li>
|
|
|
|
</ul>)
|
2022-03-24 10:53:57 +01:00
|
|
|
|
2022-07-14 07:08:41 -05:00
|
|
|
return (<DefaultErrorView inspectChildren={inspectChildren}>
|
|
|
|
<p>Don't 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
|