import { ErrorView } from 'shared/components/error/view.mjs'
export const Error = (props) => {
const errors = {
pattern: 0,
sets: 0,
}
const warnings = {
pattern: 0,
sets: 0,
}
if (props.patternLogs) {
errors.pattern += props.patternLogs.error.length
warnings.pattern += props.patternLogs.warning.length
}
if (props.setLogs) {
errors.sets += props.setLogs.error.length
warnings.sets += props.setLogs.warning.length
}
const logInfo = []
if (errors.pattern > 0)
logInfo.push(
There are {errors.pattern} errors in the pattern logs
)
if (errors.sets > 0)
logInfo.push(
There are {errors.sets} errors in the draft logs
)
if (warnings.pattern > 0)
logInfo.push(
There are {warnings.pattern} warnings in the pattern logs
)
if (warnings.sets > 0)
logInfo.push(
There are {warnings.sets} warnings in the draft logs
)
const ic = (
{logInfo}
{logInfo.length > 0 && (
-
)}
- Check the partially rendered pattern below to see which areas are problematic
)
return (
No need to be alarmed, but we ran into some trouble while drafting this pattern.
)
}