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.

51 lines
1002 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}">
  17. <span>{item.name}</span>
  18. {#if item.groupWeight !== 1}
  19. <span>({item.groupWeight})</span>
  20. {/if}
  21. </a>
  22. </div>
  23. </div>
  24. <style>
  25. div.item {
  26. display: flex;
  27. flex-direction: row;
  28. margin-top: 0.25em;
  29. margin-bottom: 0em;
  30. font-size: 0.75em;
  31. }
  32. a {
  33. color: inherit;
  34. }
  35. div.item-icon {
  36. padding: 0.25em 0.5ch 0.25em 0;
  37. }
  38. div.item-name {
  39. padding: 0.125em;
  40. }
  41. div.item-amount {
  42. padding: 0.125em;
  43. padding-right: 1ch;
  44. }
  45. div.item.noPadding {
  46. margin-top: 0em;
  47. }
  48. </style>