parent
89a020e80f
commit
6df048c3b3
4 changed files with 23 additions and 90 deletions
@ -1,21 +1,20 @@ |
||||
import React from "react"; |
||||
import React, { useState } from "react"; |
||||
|
||||
export const Checkbox = React.forwardRef(({ indeterminate, ...rest }, ref) => { |
||||
const defaultRef = React.useRef(); |
||||
const resolvedRef = ref || defaultRef; |
||||
|
||||
React.useEffect(() => { |
||||
resolvedRef.current.indeterminate = indeterminate; |
||||
}, [resolvedRef, indeterminate]); |
||||
export function Checkbox({ setFiltering, filtering, addTab }) { |
||||
// const [selectedFilterRow, setSelectedFilterRow] = useState(filtering);
|
||||
|
||||
return ( |
||||
<> |
||||
<input |
||||
type="checkbox" |
||||
className="rounded-sm " |
||||
ref={resolvedRef} |
||||
{...rest} |
||||
/> |
||||
</> |
||||
<input |
||||
// onClick={() => {
|
||||
// console.log("mahdi");
|
||||
// setFiltering(!selectedFilterRow);
|
||||
// setSelectedFilterRow(!selectedFilterRow);
|
||||
// }}
|
||||
type="checkbox" |
||||
// className={`cursor-pointer ${selectedFilterRow ? "p-72" : "p-5"}`}
|
||||
className={`cursor-pointer`} |
||||
/> |
||||
); |
||||
}); |
||||
} |
||||
|
||||
Checkbox.defaultProps = {}; |
||||
|
Loading…
Reference in new issue