local M = {}

M.set_icon = function()
  require("nvim-web-devicons").set_icon {
    toml = {
      icon = "üì¶",
      color = "#8FAA54",
      name = "Toml",
    },
    rs = {
      icon = "ü¶Ä",
      color = "#d28445",
      name = "Rust",
    },
    tf = {
      icon = "ÔÖ≥",
      color = "#3d59a1",
      name = "Terraform",
    },
    tfvars = {
      icon = "ÔÖ¥",
      color = "#51afef",
      name = "Terraform",
    },
    mod = {
      icon = "Ô≥ë",
      color = "#6a9fb5",
      name = "Mod",
    },
    sum = {
      icon = "Óòß",
      color = "#6a9fb5",
      name = "Sum",
    },
    txt = {
      icon = "ÔÄ≠",
      color = "#bbc2cf",
      name = "Text",
    },
    csv = {
      icon = "Ôúö",
      color = "#31B53E",
      name = "CSV",
    },
    plist = {
      icon = "Ôëâ",
      color = "#8FAA54",
      name = "Plist",
    },
    burp = {
      icon = "Ôàõ",
      color = "#F16529",
      name = "Burp",
    },
    mp4 = {
      icon = "ÔÄà",
      color = "#5fd7ff",
      name = "MP4",
    },
    mkv = {
      icon = "ÔÄà",
      color = "#5fd7ff",
      name = "MKV",
    },
    hcl = {
      icon = "ÔÉΩ",
      color = "#689FB6",
      name = "HCL",
    },
    sol = {
      icon = "Ôää",
      color = "#555555",
      name = "Sol",
    },
  }
end

M.use_my_icons = function()
  for _, sign in ipairs(lvim.lsp.diagnostics.signs.values) do
    vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
  end
  if lvim.builtin.tree_provider == "nvimtree" then
    lvim.builtin.nvimtree.setup.diagnostics.enable = true
    lvim.builtin.nvimtree.setup.renderer.icons.webdev_colors = true
    lvim.builtin.nvimtree.setup.renderer.icons.show = {
      git = true,
      folder = true,
      file = true,
      folder_arrow = true,
    }
  end
  if lvim.builtin.bufferline.active then
    lvim.builtin.bufferline.options.show_buffer_icons = true
    lvim.builtin.bufferline.options.show_buffer_close_icons = true
  end
end

M.define_dap_signs = function()
  vim.fn.sign_define("DapBreakpoint", lvim.builtin.dap.breakpoint)
  vim.fn.sign_define("DapStopped", lvim.builtin.dap.stopped)
  vim.fn.sign_define(
    "DapBreakpointRejected",
    { text = "ÔÅ±", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
  )
  vim.fn.sign_define(
    "DapBreakpointCondition",
    { text = "ÔÇ£", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
  )
  vim.fn.sign_define(
    "DapLogPoint",
    { text = "Ô°®", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
  )
end

return M
