diff --git a/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx b/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx index ecb5a49b4e..ed6c652462 100644 --- a/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx +++ b/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx @@ -1,17 +1,15 @@ -import { FieldURLType } from '@/application/collab.type'; import { notify } from '@/components/_shared/notify'; import RightTopActionsToolbar from '@/components/editor/components/block-actions/RightTopActionsToolbar'; import { EditorElementProps, FileNode } from '@/components/editor/editor.type'; import { copyTextToClipboard } from '@/utils/copy'; import { downloadFile } from '@/utils/download'; -import { renderDate } from '@/utils/time'; import React, { forwardRef, memo, useCallback, useMemo, useState } from 'react'; import { ReactComponent as FileIcon } from '@/assets/file_upload.svg'; import { useTranslation } from 'react-i18next'; export const FileBlock = memo( forwardRef>(({ node, children, ...attributes }, ref) => { - const { url, name, url_type, uploaded_at } = useMemo(() => node.data || {}, [node.data]); + const { url, name } = useMemo(() => node.data || {}, [node.data]); const className = useMemo(() => { const classList = ['w-full bg-bg-body py-2']; @@ -41,20 +39,6 @@ export const FileBlock = memo( } }, [url, name]); - const uploadTypePrefix = useMemo(() => { - const time = renderDate(uploaded_at, 'MMM DD, YYYY', false); - - if (url_type === FieldURLType.Upload) { - return t('web.fileBlock.uploadedAt', { - time, - }); - } else { - return t('web.fileBlock.linkedAt', { - time, - }); - } - }, [uploaded_at, url_type, t]); - return (
{name?.trim() || t('document.title.placeholder')}
-
- {uploadTypePrefix} -
:
{t('web.fileBlock.empty')}