import React from 'react';
import DocumentTags from './DocumentTags';
import type { Document, DocumentTag } from '../../types/documents';
import type { TagDragHandlers } from '../interactions/useTagInteractions';
import type { Identifier } from '../../types/identifiers';

interface EntryTagsProps {
    tags: DocumentTag[];
    tagLookupById?: Map<Identifier, DocumentTag> | null;
    onTagClick?: (tagId: Identifier) => void;
    doc: Document;
    tagDragHandlers?: TagDragHandlers;
}

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}
            tagDragHandlers={props.tagDragHandlers}
        />
    );
};

export default EntryTags;
