-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3adf54a
commit 0d1935f
Showing
7 changed files
with
230 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Tooltip } from "@mantine/core"; | ||
|
||
interface EllipsisTextProps { | ||
text: string; | ||
maxWidth?: string; | ||
} | ||
|
||
const EllipsisText = ({ text, maxWidth }: EllipsisTextProps) => { | ||
maxWidth = maxWidth || "18ch"; | ||
|
||
const style = { | ||
float: "left", | ||
maxWidth: maxWidth, | ||
whiteSpace: "nowrap", | ||
overflow: "hidden", | ||
textOverflow: "ellipsis", | ||
}; | ||
|
||
return ( | ||
<> | ||
<Tooltip label={text}> | ||
{/*@ts-ignore*/} | ||
<span style={style}>{text}</span> | ||
</Tooltip> | ||
</> | ||
); | ||
}; | ||
|
||
export default EllipsisText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.