w-funnel/src/components/admin/builder/Sidebar/ValidationSummary.tsx
dev.daminik00 b3eaa19fcd dix
2025-09-28 06:38:15 +02:00

35 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ValidationIssues } from "./types";
export interface ValidationSummaryProps {
issues: ValidationIssues;
}
export function ValidationSummary({ issues }: ValidationSummaryProps) {
if (issues.length === 0) {
return (
<div className="rounded-lg border border-border/30 bg-background/40 p-2 text-xs text-muted-foreground">
Всё хорошо воронка валидна.
</div>
);
}
return (
<div className="space-y-2">
{issues.map((issue, index) => (
<div
key={index}
className="rounded-lg border border-destructive/20 bg-destructive/5 p-2 text-xs text-destructive"
>
<div className="flex items-start gap-2">
<span className="text-destructive/80"></span>
<div>
<p className="font-medium">{issue.message}</p>
{issue.screenId && <p className="mt-1 text-destructive/80">Экран: {issue.screenId}</p>}
</div>
</div>
</div>
))}
</div>
);
}