summaryrefslogtreecommitdiff
path: root/src/components/ConnectionTable.js
diff options
context:
space:
mode:
authorHaishan <[email protected]>2020-05-14 22:50:48 +0800
committerHaishan <[email protected]>2020-05-14 22:50:48 +0800
commitfaf4cba37c8dd123600a62ec4feb39cccd851bcb (patch)
tree144bc503428ff891e74684da487f04e2fce90d57 /src/components/ConnectionTable.js
parentaceb1b4a365b1d86d66c0538011580eb01270219 (diff)
chore: lib classnames -> clsx
Diffstat (limited to 'src/components/ConnectionTable.js')
-rw-r--r--src/components/ConnectionTable.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/ConnectionTable.js b/src/components/ConnectionTable.js
index 52fd1d6..a6c90b1 100644
--- a/src/components/ConnectionTable.js
+++ b/src/components/ConnectionTable.js
@@ -2,7 +2,7 @@ import React from 'react';
import { ChevronDown } from 'react-feather';
import prettyBytes from '../misc/pretty-bytes';
import { formatDistance } from 'date-fns';
-import cx from 'classnames';
+import cx from 'clsx';
import { useTable, useSortBy } from 'react-table';
import s from './ConnectionTable.module.css';
@@ -21,7 +21,7 @@ const columns = [
{ Header: 'Time', accessor: 'start' },
{ Header: 'Source IP', accessor: 'sourceIP' },
{ Header: 'Source Port', accessor: 'sourcePort' },
- { Header: 'Destination IP', accessor: 'destinationIP' }
+ { Header: 'Destination IP', accessor: 'destinationIP' },
];
function renderCell(cell, now) {
@@ -43,9 +43,9 @@ const sortById = { id: 'id', desc: true };
const tableState = {
sortBy: [
// maintain a more stable order
- sortById
+ sortById,
],
- hiddenColumns: ['id']
+ hiddenColumns: ['id'],
};
function Table({ data }) {
@@ -55,17 +55,17 @@ function Table({ data }) {
columns,
data,
initialState: tableState,
- autoResetSortBy: false
+ autoResetSortBy: false,
},
useSortBy
);
return (
<div {...getTableProps()}>
<div className={s.thead}>
- {headerGroups.map(headerGroup => {
+ {headerGroups.map((headerGroup) => {
return (
<div {...headerGroup.getHeaderGroupProps()} className={s.tr}>
- {headerGroup.headers.map(column => (
+ {headerGroup.headers.map((column) => (
<div
{...column.getHeaderProps(column.getSortByToggleProps())}
className={s.th}