Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezr committed Oct 10, 2023
1 parent 193e5e7 commit 24bf199
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions source/frontend/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import './Table.scss';

import classnames from 'classnames';
import classNames from 'classnames';
import clsx from 'classnames';
import cx from 'classnames';
import { Form, Formik, FormikProps } from 'formik';
import keys from 'lodash/keys';
import map from 'lodash/map';
Expand Down Expand Up @@ -518,7 +516,7 @@ export const Table = <T extends IIdentifiedObject, TFilter extends object = {}>(
{...(props.hideHeaders
? columnProps.getHeaderProps(noHeadersGetter)
: columnProps.getHeaderProps(headerPropsGetter))}
className={classnames(
className={cx(
'th',
columnProps.isSorted ? (columnProps.isSortedDesc ? 'sort-desc' : 'sort-asc') : '',
)}
Expand Down Expand Up @@ -635,7 +633,7 @@ export const Table = <T extends IIdentifiedObject, TFilter extends object = {}>(
const renderRow = (row: Row<T>, index: number) => {
return (
<div key={index} className="tr-wrapper">
<div {...row.getRowProps()} className={clsx('tr', row.isSelected ? 'selected' : '')}>
<div {...row.getRowProps()} className={cx('tr', row.isSelected ? 'selected' : '')}>
{/* If canRowExpand prop is passed only allow expansions on those rows */}
{props.canRowExpand &&
props.canRowExpand(row) &&
Expand Down Expand Up @@ -666,7 +664,7 @@ export const Table = <T extends IIdentifiedObject, TFilter extends object = {}>(
<div
{...cell.getCellProps(cellPropsGetter)}
title={cell.column.clickable && clickableTooltip ? clickableTooltip : ''}
className={classnames(
className={cx(
'td',
cell.column.clickable ? 'clickable' : '',
cell.column.className,
Expand Down Expand Up @@ -733,7 +731,7 @@ export const Table = <T extends IIdentifiedObject, TFilter extends object = {}>(
<>
<div
{...getTableProps({ style: { minWidth: undefined } })}
className={classNames('table', props.className ?? '')}
className={cx('table', props.className ?? '')}
data-testid={`${props.name}`}
>
<div className="thead thead-light">
Expand Down Expand Up @@ -769,7 +767,7 @@ export const Table = <T extends IIdentifiedObject, TFilter extends object = {}>(
<RowBootstrap>
<ColBootstrap xs="auto" className="align-self-center">
{canShowTotals && props.data.length > 0 && (
<span>{`${initialCount} - ${finalCount} of ${totalItems}`}</span>
<span>{`${initialCount} - ${finalCount} of ${totalItems}`}</span>
)}
</ColBootstrap>
<ColBootstrap xs="auto" className="ml-auto align-self-center">
Expand Down

0 comments on commit 24bf199

Please sign in to comment.