import { HTMLProps, useEffect, useRef } from "react";
function IndeterminateCheckbox({
indeterminate,
className = "",
...rest
}: { indeterminate?: boolean } & HTMLProps) {
const ref = useRef(null!);
useEffect(() => {
if (typeof indeterminate === "boolean") {
ref.current.indeterminate = !rest.checked && indeterminate;
}
}, [ref, indeterminate]);
return (
);
}
export default IndeterminateCheckbox;