This commit is contained in:
2025-11-10 00:24:07 -03:00
parent 7f385bf175
commit 24dfefe395
6 changed files with 66 additions and 42 deletions

View File

@@ -0,0 +1,16 @@
type AbbrProps = {
children: string
maxLen?: number
}
export function Abbr({ children, maxLen = 30, ...props }: AbbrProps) {
if (children.length <= maxLen) {
return <abbr {...props}>{children}</abbr>
}
return (
<abbr title={children} {...props}>
{children.substring(0, maxLen).concat('...')}
</abbr>
)
}