@use "sass:map";
@use "sass:math";
@use "@twig/scss/_global" as global;
@use "@twig/scss/variables/_variables-components" as components;

$params: (
   "gap": 5px,
   "text-decoration-mixin": "hover",
   "hide-icon": "false",
);

@if global-variable-exists(c-switcher-currency-trigger, components) {
   $keys: map.keys(components.$c-switcher-currency-trigger);
   @each $name in $keys {
      @if not map.get($params, $name) {
         @warn "Neexistující proměnná '#{$name}' v komponentě '$#{component("Switcher:Currency:Trigger", "class")}'.";
      }
   }

   $params: map.merge($params, components.$c-switcher-currency-trigger);
}

.#{component("Switcher:Currency:Trigger", "class")} {
   a {
      display: inline-flex;
      align-items: center;
      gap: map.get($params, "gap");

      @if (map.get($params, "text-decoration-mixin") == "default") {
         @include global.underline-default;
      } @else if (map.get($params, "text-decoration-mixin") == "hover") {
         @include global.underline-hover;
      }

      @if (map.get($params, "hide-icon") == "true") {
         .c-icon {
            display: none;
         }
      }
   }
}
