feat: refactor frontend document tag display by removing EntryTags.

This commit is contained in:
2025-12-09 00:21:15 +01:00
parent f3292211a8
commit a8c133bbf9
3 changed files with 4 additions and 35 deletions
@@ -9,7 +9,7 @@ import { useDocumentsCommandContext } from '../context/DocumentsCommandContext';
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
import EditableEntryTitle from './EditableEntryTitle';
import EntryCorrespondents from './EntryCorrespondents';
import EntryTags from './EntryTags';
import DocumentTags from './DocumentTags';
import FolderEntry from './FolderEntry';
import DocumentEntry from './DocumentEntry';
import { TagInteractionHandlers } from '../interactions/useTagInteractions';
@@ -122,7 +122,7 @@ const DocumentsGridCard: React.FC<DocumentsGridCardProps> = (props) => {
</div>
</div>
<div className="document-card__tags">
<EntryTags
<DocumentTags
tags={doc.tags || []}
tagLookupById={tagLookupById}
onTagClick={onTagClick}
@@ -10,7 +10,7 @@ import { useDocumentsCommandContext } from '../context/DocumentsCommandContext';
import type { DocumentViewLogic } from '../logic/useDocumentViewLogic';
import EditableEntryTitle from './EditableEntryTitle';
import EntryCorrespondents from './EntryCorrespondents';
import EntryTags from './EntryTags';
import DocumentTags from './DocumentTags';
import FolderEntry from './FolderEntry';
import DocumentEntry from './DocumentEntry';
@@ -137,7 +137,7 @@ const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
</span>
</div>
<div className="doc-name__tags">
<EntryTags
<DocumentTags
tags={doc.tags || []}
tagLookupById={tagLookupById}
onTagClick={onTagClick}
@@ -1,31 +0,0 @@
import React from 'react';
import DocumentTags from './DocumentTags';
import type { Document, DocumentTag } from '../../types/documents';
import type { TagInteractionHandlers } from '../interactions/useTagInteractions';
import type { Identifier } from '../../types/identifiers';
interface EntryTagsProps {
tags: DocumentTag[];
tagLookupById?: Map<Identifier, DocumentTag> | null;
onTagClick?: (tagId: Identifier) => void;
doc: Document;
tagHandlers?: TagInteractionHandlers;
}
const EntryTags: React.FC<EntryTagsProps> = (props) => {
if (!props.tags || props.tags.length === 0) {
return null;
}
return (
<DocumentTags
tags={props.tags}
tagLookupById={props.tagLookupById}
onTagClick={props.onTagClick}
doc={props.doc}
tagHandlers={props.tagHandlers}
/>
);
};
export default EntryTags;