mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 14:38:50 +00:00
refactor(nui): Truncate query text and show tooltip
This commit is contained in:
1 parent
16d7f547d2
commit
236be18736
1 file changed
+4
-4
@@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
|
|||||||
import { useEffect, useState, useMemo } from 'react';
|
import { useEffect, useState, useMemo } from 'react';
|
||||||
import { fetchNui } from '../utils/fetchNui';
|
import { fetchNui } from '../utils/fetchNui';
|
||||||
import { useNuiEvent } from '../hooks/useNuiEvent';
|
import { useNuiEvent } from '../hooks/useNuiEvent';
|
||||||
import { Table, Thead, Tbody, Tr, Th, Td, chakra, Flex, IconButton, Text, Spinner } from '@chakra-ui/react';
|
import { Table, Thead, Tbody, Tr, Th, Td, chakra, Flex, IconButton, Text, Spinner, Tooltip } from '@chakra-ui/react';
|
||||||
import {
|
import {
|
||||||
TriangleDownIcon,
|
TriangleDownIcon,
|
||||||
TriangleUpIcon,
|
TriangleUpIcon,
|
||||||
@@ -135,17 +135,17 @@ const Resource: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<Tr {...row.getRowProps()}>
|
<Tr {...row.getRowProps()}>
|
||||||
{row.cells.map((cell) => (
|
{row.cells.map((cell) => (
|
||||||
|
<Tooltip isDisabled={cell.column.id === 'executionTime'} label={cell.value} openDelay={500}>
|
||||||
<Td
|
<Td
|
||||||
{...cell.getCellProps()}
|
{...cell.getCellProps()}
|
||||||
fontFamily="Poppins"
|
fontFamily="Poppins"
|
||||||
wordBreak="break-word"
|
|
||||||
textOverflow="ellipsis"
|
|
||||||
overflow="hidden"
|
|
||||||
borderBottomColor="#313C4A"
|
borderBottomColor="#313C4A"
|
||||||
|
isTruncated={cell.column.id === 'query'}
|
||||||
textAlign={cell.column.id === 'executionTime' ? 'center' : 'left'}
|
textAlign={cell.column.id === 'executionTime' ? 'center' : 'left'}
|
||||||
>
|
>
|
||||||
{cell.render('Cell')}
|
{cell.render('Cell')}
|
||||||
</Td>
|
</Td>
|
||||||
|
</Tooltip>
|
||||||
))}
|
))}
|
||||||
</Tr>
|
</Tr>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user