InvalidSettingsNotice

Tell the user that a settings file failed validation and is ignored, and offer a way out. Place it above the chat or at the top of a settings screen. The description is built from the problem count: pass errors to show the count and an expandable ValidationErrorsList (Show details), or only count when the details are not available. The color follows the errors: red when at least one is an error, yellow when all are warnings; severity overrides it. Actions appear only for the callbacks you pass: Open file (onOpenFile), Continue without this file (onContinueWithout, which may return a promise: the button shows a loader and a rejection message is shown inside the alert) and a close button (onDismiss). defaultExpanded opens the details initially; title, description and labels (with labels.list for the error list) replace the English texts.

Getting Started
$pnpm add @sinups/ai-kit @mantine/core @mantine/hooks @tabler/icons-react
Examples
Errors with actions
Warnings, count only, failing action
API reference
Prop
Type
Required
file
string
Yes
Settings file that failed validation
errors
SettingsValidationError[]
No
Problems found in the file; their count is shown and they can be expanded
count
number
No
Number of problems when `errors` is not passed
severity
SettingsValidationSeverity
No
`error` renders a red alert, `warning` a yellow one; derived from `errors` by default
title
React.ReactNode
No
Overrides the title
description
React.ReactNode
No
Overrides the description
onContinueWithout
() => void | Promise<void>
No
Adds "Continue without this file"; the button shows a loader until the promise settles
onOpenFile
(file: string) => void
No
Adds "Open file"
onDismiss
() => void
No
Renders a close button
defaultExpanded
boolean
No
Shows the error list expanded initially
labels
Partial<InvalidSettingsNoticeLabels>
No
Overrides of the default English labels
className
string
No
Class name added to the root element
style
React.CSSProperties
No
Inline styles added to the root element