-- nvim-web-devicons.lua: Adds icons for file types to improve visual navigation.

return {
  {
    "nvim-tree/nvim-web-devicons",
    lazy = true,
    config = function()
      require("nvim-web-devicons").setup({
        -- Globally enable/disable all icons
        override = {
          -- Override specific file type icons
          zsh = {
            icon = "",
            color = "#428850",
            cterm_color = "65",
            name = "Zsh",
          },
          -- Add custom icons
          ["Dockerfile"] = {
            icon = "",
            color = "#384d54",
            name = "Dockerfile",
          },
          [".env"] = {
            icon = "",
            color = "#faf743",
            name = "Env",
          },
          [".gitignore"] = {
            icon = "",
            color = "#f1502f",
            name = "GitIgnore",
          },
        },
        -- Override by file extension
        override_by_extension = {
          ["log"] = {
            icon = "",
            color = "#81e043",
            name = "Log",
          },
          ["rs"] = {
            icon = "",
            color = "#dea584",
            name = "Rust",
          },
          ["md"] = {
            icon = "",
            color = "#519aba",
            name = "Markdown",
          },
        },
        -- Override by filename
        override_by_filename = {
          ["makefile"] = {
            icon = "",
            color = "#6d8086",
            name = "Makefile",
          },
          ["dockerfile"] = {
            icon = "",
            color = "#384d54",
            name = "Dockerfile",
          },
          [".dockerignore"] = {
            icon = "",
            color = "#384d54",
            name = "DockerIgnore",
          },
          ["package.json"] = {
            icon = "",
            color = "#e8274b",
            name = "PackageJson",
          },
          ["package-lock.json"] = {
            icon = "",
            color = "#7a0d21",
            name = "PackageLockJson",
          },
        },
        -- Use colors by default
        color_icons = true,
        -- Globally enable default icons (if icon not found)
        default = true,
        -- Use strict mode (throw error if icon not found)
        strict = false,
      })
    end,
  },
}
