mirror of
https://github.com/get-drexa/drive.git
synced 2025-12-01 05:51:39 +00:00
feat: basic recent file browsing
This commit is contained in:
13
apps/drive-web/src/components/ui/middle-truncated-text.tsx
Normal file
13
apps/drive-web/src/components/ui/middle-truncated-text.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
function MiddleTruncatedText({ children }: { children: string }) {
|
||||
const LAST_PART_LENGTH = 3
|
||||
const lastPart = children.slice(children.length - LAST_PART_LENGTH)
|
||||
const firstPart = children.slice(0, children.length - LAST_PART_LENGTH)
|
||||
return (
|
||||
<p className="max-w-full flex">
|
||||
<span className="flex-1 truncate">{firstPart}</span>
|
||||
<span className="w-min">{lastPart}</span>
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
export { MiddleTruncatedText }
|
||||
Reference in New Issue
Block a user