@primer/react
Version:
An implementation of GitHub's Primer Design System using React
41 lines (38 loc) • 945 B
JavaScript
import { c } from 'react-compiler-runtime';
import InputValidation from '../internal/components/InputValidation.js';
import { useFormControlContext } from './_FormControlContext.js';
import { jsx } from 'react/jsx-runtime';
const FormControlValidation = t0 => {
const $ = c(6);
const {
children,
className,
variant,
sx,
id
} = t0;
const {
validationMessageId
} = useFormControlContext();
const t1 = id || validationMessageId || "";
let t2;
if ($[0] !== children || $[1] !== className || $[2] !== sx || $[3] !== t1 || $[4] !== variant) {
t2 = /*#__PURE__*/jsx(InputValidation, {
className: className,
validationStatus: variant,
id: t1,
sx: sx,
children: children
});
$[0] = children;
$[1] = className;
$[2] = sx;
$[3] = t1;
$[4] = variant;
$[5] = t2;
} else {
t2 = $[5];
}
return t2;
};
export { FormControlValidation as default };