mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 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
+12
-12
@@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
|
||||
import { useEffect, useState, useMemo } from 'react';
|
||||
import { fetchNui } from '../utils/fetchNui';
|
||||
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 {
|
||||
TriangleDownIcon,
|
||||
TriangleUpIcon,
|
||||
@@ -135,17 +135,17 @@ const Resource: React.FC = () => {
|
||||
return (
|
||||
<Tr {...row.getRowProps()}>
|
||||
{row.cells.map((cell) => (
|
||||
<Td
|
||||
{...cell.getCellProps()}
|
||||
fontFamily="Poppins"
|
||||
wordBreak="break-word"
|
||||
textOverflow="ellipsis"
|
||||
overflow="hidden"
|
||||
borderBottomColor="#313C4A"
|
||||
textAlign={cell.column.id === 'executionTime' ? 'center' : 'left'}
|
||||
>
|
||||
{cell.render('Cell')}
|
||||
</Td>
|
||||
<Tooltip isDisabled={cell.column.id === 'executionTime'} label={cell.value} openDelay={500}>
|
||||
<Td
|
||||
{...cell.getCellProps()}
|
||||
fontFamily="Poppins"
|
||||
borderBottomColor="#313C4A"
|
||||
isTruncated={cell.column.id === 'query'}
|
||||
textAlign={cell.column.id === 'executionTime' ? 'center' : 'left'}
|
||||
>
|
||||
{cell.render('Cell')}
|
||||
</Td>
|
||||
</Tooltip>
|
||||
))}
|
||||
</Tr>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user