diff --git a/src/pages/Connections.tsx b/src/pages/Connections.tsx index 6f553a3..b3e6573 100644 --- a/src/pages/Connections.tsx +++ b/src/pages/Connections.tsx @@ -36,10 +36,14 @@ import { CONNECTIONS_TABLE_ACCESSOR_KEY, CONNECTIONS_TABLE_INITIAL_COLUMN_ORDER, CONNECTIONS_TABLE_INITIAL_COLUMN_VISIBILITY, - TAILWINDCSS_SIZE, } from '~/constants' import { formatTimeFromNow } from '~/helpers' -import { secret, tableSize, useRequest, wsEndpointURL } from '~/signals' +import { + secret, + tableSizeClassName, + useRequest, + wsEndpointURL, +} from '~/signals' import type { Connection } from '~/types' type ConnectionWithSpeed = Connection & { @@ -313,28 +317,6 @@ export default () => { getCoreRowModel: getCoreRowModel(), }) - const tableSizeClassName = () => { - const size = tableSize() - let className = 'table-xs' - - switch (size) { - case TAILWINDCSS_SIZE.XS: - className = 'table-xs' - break - case TAILWINDCSS_SIZE.SM: - className = 'table-sm' - break - case TAILWINDCSS_SIZE.MD: - className = 'table-md' - break - case TAILWINDCSS_SIZE.LG: - className = 'table-lg' - break - } - - return className - } - const tabs = () => [ { type: ActiveTab.activeConnections, diff --git a/src/pages/Logs.tsx b/src/pages/Logs.tsx index 62ca70d..31349f7 100644 --- a/src/pages/Logs.tsx +++ b/src/pages/Logs.tsx @@ -9,7 +9,7 @@ import { } from '@tanstack/solid-table' import { For, createEffect, createSignal } from 'solid-js' import { twMerge } from 'tailwind-merge' -import { secret, tableSize, wsEndpointURL } from '~/signals' +import { secret, tableSizeClassName, wsEndpointURL } from '~/signals' import { Log } from '~/types' type LogWithSeq = Log & { seq: number } @@ -76,7 +76,9 @@ export default () => { />