import { useEffect, useState } from 'react'; import { useAI } from '../hooks/useAI'; import { markdownToHtml } from '../lib/markdown'; export interface ModalIssue { title: string; severity: string; wcag?: string; selector?: string; element?: string; description: string; count?: number; ai_fixable?: boolean; help_url?: string; } interface Props { issue: ModalIssue | null; onClose: () => void; } /** Renders AI response with full markdown formatting. */ function AiSuggestion({ text }: { text: string }) { return (
Suggested fix
AI suggestions are based on automated analysis. Please review before applying.
{issue.description}
This issue may affect accessibility for some users and should be reviewed.
{(issue.selector || issue.count !== undefined) && ({issue.selector}Affected element
{issue.element}
Configure an AI provider in Settings to enable fix suggestions.
)} {aiError &&{aiError}
} {aiOutput !== null && !aiError &&