Home / Function/ SelectHeaderCell() — supabase Function Reference

SelectHeaderCell() — supabase Function Reference

Architecture documentation for the SelectHeaderCell() function in UsersGridComponents.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Auth/Users/UsersGridComponents.tsx lines 13–44

export const SelectHeaderCell = ({
  selectedUsers,
  allRowsSelected,
}: {
  selectedUsers: Set<any>
  allRowsSelected: boolean
}) => {
  const inputRef = useRef<HTMLInputElement>(null)
  const [isRowSelected, onRowSelectionChange] = useRowSelection()

  const isIndeterminate = selectedUsers.size > 0 && !allRowsSelected

  useEffect(() => {
    if (inputRef.current) inputRef.current.indeterminate = isIndeterminate
  }, [isIndeterminate])

  return (
    <div className="px-4 flex items-center sb-grid">
      <div className="sb-grid-select-cell__header">
        <input
          ref={inputRef}
          type="checkbox"
          aria-label="Select-all"
          className="sb-grid-select-cell__header__input"
          disabled={false}
          checked={isRowSelected}
          onChange={(e) => onRowSelectionChange({ type: 'HEADER', checked: e.target.checked })}
        />
      </div>
    </div>
  )
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free