You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
909 B

  1. <script lang="ts">
  2. import type Item from "../models/item";
  3. import Icon from "./Icon.svelte";
  4. export let item: Item = null;
  5. export let amount: number = null;
  6. export let noPadding: boolean = false;
  7. </script>
  8. <div class="item" class:noPadding>
  9. {#if amount != null}
  10. <div class="item-amount">{amount}x</div>
  11. {/if}
  12. <div class="item-icon">
  13. <Icon name={item.icon} />
  14. </div>
  15. <div class="item-name">
  16. <a href="/items#{item.groupId}">{item.name} ({item.groupWeight})</a>
  17. </div>
  18. </div>
  19. <style>
  20. div.item {
  21. display: flex;
  22. flex-direction: row;
  23. margin-top: 0.25em;
  24. margin-bottom: 0em;
  25. font-size: 0.75em;
  26. }
  27. a {
  28. color: inherit;
  29. }
  30. div.item-icon {
  31. padding: 0.25em 0.5ch 0.25em 0;
  32. }
  33. div.item-name {
  34. padding: 0.125em;
  35. }
  36. div.item-amount {
  37. padding: 0.125em;
  38. padding-right: 1ch;
  39. }
  40. div.item.noPadding {
  41. margin-top: 0em;
  42. }
  43. </style>