update structuring

This commit is contained in:
Abhinav 2022-06-28 14:44:01 +05:30
parent f4fde02193
commit 4c2bca8e58

View file

@ -1,19 +1,15 @@
import Tooltip from '@mui/material/Tooltip'; import Tooltip from '@mui/material/Tooltip';
import React from 'react'; import React from 'react';
import { Box, styled, Typography } from '@mui/material'; import { Box, Typography } from '@mui/material';
export const EllipseText = styled(Typography)`
/* white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; */
word-break: break-word;
`;
export default function TruncateText({ text }) { export default function TruncateText({ text }) {
return ( return (
<Tooltip title={text}> <Tooltip title={text}>
<Box height={34} overflow="hidden"> <Box height={34} overflow="hidden">
{/* todo add ellipsis */} {/* todo add ellipsis */}
<EllipseText variant="body2">{text}</EllipseText> <Typography variant="body2" sx={{ wordBreak: 'break-word' }}>
{text}
</Typography>
</Box> </Box>
</Tooltip> </Tooltip>
); );