"""Media type icon mappings and badge color definitions for the gallery."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/core/icons.ipynb.

# %% auto #0
__all__ = ['MEDIA_TYPE_ICONS', 'GALLERY_ICONS', 'MEDIA_TYPE_BADGE_COLORS', 'MEDIA_TYPE_TEXT_COLORS', 'get_media_type_icon',
           'get_gallery_icon']

# %% ../../nbs/core/icons.ipynb #c3d4e5f6
from typing import Any, Dict

from cjm_file_discovery.core.models import FileType
from cjm_fasthtml_lucide_icons.factory import lucide_icon
from cjm_fasthtml_daisyui.utilities.semantic_colors import text_dui
from cjm_fasthtml_daisyui.components.data_display.badge import badge_colors, badge_styles

# %% ../../nbs/core/icons.ipynb #e5f6a7b8
MEDIA_TYPE_ICONS: Dict[FileType, str] = {
    FileType.AUDIO: "file-music",
    FileType.VIDEO: "file-video-camera",
    FileType.IMAGE: "image",
    FileType.DOCUMENT: "file-text",
    FileType.CODE: "file-code",
    FileType.DATA: "database",
    FileType.ARCHIVE: "archive",
    FileType.OTHER: "file",
}

# %% ../../nbs/core/icons.ipynb #h8c9d0e1
GALLERY_ICONS: Dict[str, str] = {
    # View toggles
    "grid_view": "grid-3x3",
    "list_view": "list",
    
    # Playback controls
    "play": "play",
    "pause": "pause",
    "stop": "square",
    "volume": "volume-2",
    "volume_mute": "volume-x",
    
    # Modal controls
    "fullscreen": "maximize",
    "exit_fullscreen": "minimize",
    "close": "x",
    "download": "download",
    "info": "info",
    
    # Navigation
    "prev": "chevron-left",
    "next": "chevron-right",
    "first": "chevrons-left",
    "last": "chevrons-right",
    
    # Selection
    "check": "check",
    "select_all": "check-check",
    
    # Filter
    "filter": "filter",
    "filter_x": "filter-x",
}

# %% ../../nbs/core/icons.ipynb #k1f2g3h4
MEDIA_TYPE_BADGE_COLORS: Dict[FileType, str] = {
    FileType.AUDIO: str(badge_colors.info),
    FileType.VIDEO: str(badge_colors.primary),
    FileType.IMAGE: str(badge_colors.success),
    FileType.DOCUMENT: str(badge_colors.warning),
    FileType.CODE: str(badge_colors.secondary),
    FileType.DATA: str(badge_colors.accent),
    FileType.ARCHIVE: str(badge_colors.neutral),
    FileType.OTHER: str(badge_styles.ghost),
}

# %% ../../nbs/core/icons.ipynb #m3h4i5j6
MEDIA_TYPE_TEXT_COLORS: Dict[FileType, str] = {
    FileType.AUDIO: str(text_dui.info),
    FileType.VIDEO: str(text_dui.primary),
    FileType.IMAGE: str(text_dui.success),
    FileType.DOCUMENT: str(text_dui.warning),
    FileType.CODE: str(text_dui.secondary),
    FileType.DATA: str(text_dui.accent),
    FileType.ARCHIVE: str(text_dui.neutral),
    FileType.OTHER: str(text_dui.base_content),
}

# %% ../../nbs/core/icons.ipynb #p6k7l8m9
def get_media_type_icon(
    file_type: FileType,  # File type to get icon for
    size: int = 4,        # Icon size (Tailwind scale)
    with_color: bool = True  # Apply semantic color
) -> Any:  # Lucide icon component
    """Get the appropriate icon for a file type."""
    icon_name = MEDIA_TYPE_ICONS.get(file_type, "file")
    color_cls = MEDIA_TYPE_TEXT_COLORS.get(file_type, "") if with_color else ""
    return lucide_icon(icon_name, size=size, cls=color_cls)

# %% ../../nbs/core/icons.ipynb #r8m9n0o1
def get_gallery_icon(
    icon_key: str,        # Key from GALLERY_ICONS
    size: int = 4,        # Icon size (Tailwind scale)
    cls: str = ""         # Additional CSS classes
) -> Any:  # Lucide icon component
    """Get a gallery UI icon by key."""
    icon_name = GALLERY_ICONS.get(icon_key, "circle-question-mark")
    return lucide_icon(icon_name, size=size, cls=cls)
