({
item,
children,
state
}: {
item: any;
children: ReactNode;
state: any;
})
| 160 | } |
| 161 | |
| 162 | export function TableRow({ |
| 163 | item, |
| 164 | children, |
| 165 | state |
| 166 | }: { |
| 167 | item: any; |
| 168 | children: ReactNode; |
| 169 | state: any; |
| 170 | }): JSX.Element { |
| 171 | let ref = useRef<HTMLTableRowElement | null>(null); |
| 172 | let isSelected = state.selectionManager.isSelected(item.key); |
| 173 | let {rowProps} = useTableRow({node: item}, state, ref); |
| 174 | let {isFocusVisible, focusProps} = useFocusRing(); |
| 175 | |
| 176 | return ( |
| 177 | <tr |
| 178 | style={{ |
| 179 | // eslint-disable-next-line no-nested-ternary |
| 180 | background: isSelected ? 'blueviolet' : item.index % 2 ? 'lightgray' : 'none', |
| 181 | color: isSelected ? 'white' : undefined, |
| 182 | outline: isFocusVisible ? '2px solid orange' : 'none' |
| 183 | }} |
| 184 | {...mergeProps(rowProps, focusProps)} |
| 185 | ref={ref}> |
| 186 | {children} |
| 187 | </tr> |
| 188 | ); |
| 189 | } |
| 190 | |
| 191 | export function TableCell({cell, state}: {cell: any; state: any}): JSX.Element { |
| 192 | let ref = useRef<HTMLTableCellElement | null>(null); |
nothing calls this directly
no test coverage detected