Files
saladeaula.digital/apps/admin.saladeaula.digital/app/components/abbr.tsx
2025-11-10 00:24:07 -03:00

17 lines
336 B
TypeScript

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>
)
}