feat(qa): integrate financial example, growth, dividends and detailed declarations
This commit is contained in:
@@ -3,20 +3,23 @@ import {
|
||||
businessPlanWarnings,
|
||||
type PlanWarningMetrics,
|
||||
type PlanWarningLimits,
|
||||
type PlanWarning,
|
||||
} from '@/lib/business-plan-guidance';
|
||||
|
||||
export function BusinessPlanWarnings({
|
||||
metrics,
|
||||
metrics = {},
|
||||
limits,
|
||||
warnings: suppliedWarnings,
|
||||
}: {
|
||||
metrics: PlanWarningMetrics;
|
||||
metrics?: PlanWarningMetrics;
|
||||
limits?: PlanWarningLimits;
|
||||
warnings?: PlanWarning[];
|
||||
}) {
|
||||
const [dismissed, setDismissed] = useState<string[]>([]);
|
||||
const scope = JSON.stringify(metrics);
|
||||
const warnings = businessPlanWarnings(metrics, limits).filter(
|
||||
(warning) => !dismissed.includes(`${scope}:${warning.id}`),
|
||||
);
|
||||
const scope = JSON.stringify([metrics, suppliedWarnings, limits]);
|
||||
const warnings = (
|
||||
suppliedWarnings ?? businessPlanWarnings(metrics, limits)
|
||||
).filter((warning) => !dismissed.includes(`${scope}:${warning.id}`));
|
||||
if (!warnings.length) return null;
|
||||
return (
|
||||
<aside
|
||||
|
||||
Reference in New Issue
Block a user