= ({ fg, bg, large, label, onUseSuggestion }) => {
+ const { design } = useSiteDesign();
+ const v = checkContrast(fg, bg, design, { large });
+
+ if (v.status === 'pass') return null;
+
+ if (v.status === 'unchecked') {
+ if (v.reason !== 'gradient' && v.reason !== 'image') return null;
+ return (
+
+ Contrast not checked ({v.reason})
+
+ );
+ }
+
+ const fix = onUseSuggestion ? suggestFix(fg, bg, design, { large }) : null;
+ return (
+
+
+ {label ? `${label}: ` : ''}Low contrast {v.ratio!.toFixed(2)}:1 (needs {v.required}:1)
+
+ {fix && (
+
+ )}
+
+ );
+};