diff --git a/web/src/components/file-extra.tsx b/web/src/components/file-extra.tsx index 251f579..da18afb 100644 --- a/web/src/components/file-extra.tsx +++ b/web/src/components/file-extra.tsx @@ -24,9 +24,10 @@ import useIsMobile from "@/hooks/use-is-mobile"; interface FileExtraProps { file: TelegramFile; rowHeight: RowHeight; + ellipsis?: boolean; } -function FileName({ file }: { file: TelegramFile }) { +function FileName({ file, ellipsis }: FileExtraProps) { if (!file.fileName) { return null; } @@ -34,7 +35,12 @@ function FileName({ file }: { file: TelegramFile }) {

- + {file.fileName}

@@ -42,7 +48,7 @@ function FileName({ file }: { file: TelegramFile }) { ); } -function FileCaption({ file, rowHeight }: FileExtraProps) { +function FileCaption({ file, rowHeight, ellipsis }: FileExtraProps) { if (!file.caption) { return null; } @@ -54,8 +60,8 @@ function FileCaption({ file, rowHeight }: FileExtraProps) {

{file.caption} @@ -75,7 +81,7 @@ function FileCaption({ file, rowHeight }: FileExtraProps) { ); } -function FilePath({ file }: { file: TelegramFile }) { +function FilePath({ file, ellipsis }: FileExtraProps) { const [, copyToClipboard] = useCopyToClipboard(); const isMobile = useIsMobile(); @@ -89,7 +95,8 @@ function FilePath({ file }: { file: TelegramFile }) {

!isMobile && copyToClipboard(file.localPath)} @@ -108,7 +115,7 @@ function FilePath({ file }: { file: TelegramFile }) { ); } -function FileTime({ file }: { file: TelegramFile }) { +function FileTime({ file }: FileExtraProps) { const isMobile = useIsMobile(); return (

@@ -134,7 +141,7 @@ function FileTime({ file }: { file: TelegramFile }) {

- + {formatDistanceToNow(new Date(file.completionDate), { addSuffix: true, })} @@ -156,7 +163,8 @@ function hasValue(value: string | null | undefined): boolean { return value !== null && value !== undefined && value.trim() !== ""; } -export default function FileExtra({ file, rowHeight }: FileExtraProps) { +export default function FileExtra(fileExtraProps: FileExtraProps) { + const { file, rowHeight } = fileExtraProps; if (rowHeight === "s") { const renderOrder = [ { key: "fileName", Component: FileName }, @@ -172,7 +180,7 @@ export default function FileExtra({ file, rowHeight }: FileExtraProps) { ) { return ( - + ); } @@ -182,10 +190,10 @@ export default function FileExtra({ file, rowHeight }: FileExtraProps) { return (

- - - - + + + +
); diff --git a/web/src/components/mobile/file-card.tsx b/web/src/components/mobile/file-card.tsx index d581816..b1ed4b9 100644 --- a/web/src/components/mobile/file-card.tsx +++ b/web/src/components/mobile/file-card.tsx @@ -50,7 +50,7 @@ export function FileCard({
- +