VandyHacks/vaken

View on GitHub
src/client/routes/manage/Row.tsx

Summary

Maintainability
A
0 mins
Test Coverage
D
66%
import React, { FunctionComponent } from 'react';
import { createSelectable } from 'react-selectable-fast';
import { TableRowProps } from 'react-virtualized';

interface Props extends TableRowProps {
    selectableRef: string;
    selected: boolean;
}

export const Row: FunctionComponent<Props> = (props: Props): JSX.Element => {
    const { className, columns, style, selectableRef, selected } = props;

    return (
        <div
            key={columns[2].props.title}
            className={`${className} ${selected && 'selected'}`}
            style={style}
            ref={selectableRef}>
            {columns}
        </div>
    );
};

export default createSelectable(Row);