forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTreeRowWrapper.tsx
More file actions
27 lines (26 loc) · 895 Bytes
/
Copy pathTreeRowWrapper.tsx
File metadata and controls
27 lines (26 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/Table/table';
import { RowWrapperProps } from './RowWrapper';
import { Tr } from '../TableComposable';
export const TreeRowWrapper: React.FunctionComponent<RowWrapperProps> = ({
className,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
rowProps,
...props
}: RowWrapperProps) => {
const { level, posinset, setsize, isExpanded, isHidden } = props.row.props;
return (
<Tr
role="treeitem"
aria-level={level}
aria-posinset={posinset}
aria-setsize={setsize}
aria-expanded={!!isExpanded}
isHidden={isHidden}
className={css(className, isExpanded && 'pf-m-expandable', isExpanded && styles.modifiers.expanded)}
{...props}
/>
);
};
TreeRowWrapper.displayName = 'TreeRowWrapper';