aboutsummaryrefslogtreecommitdiffstats
path: root/components/base/ItemStack/ItemStackFormOptionLabel.vue
blob: e334950f3fe6a9b7bf6051249a4924ef59bb6434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script setup lang="ts">
defineProps<{
  option: string;
  label: string;
  type: string;
  isOptionSetFn: (option: string) => boolean;
  removeOptionFn: (option: string) => void;
  setOptionFn: (option: string, type: any) => void;
}>();
</script>

<template>
  <div class="label-with-button">
    <label :for="'itemstack-' + option">{{ label }}</label>

    <Button
      v-if="isOptionSetFn(option)"
      label="Remove"
      :icon="['fas', 'minus']"
      @click="removeOptionFn(option)"
    ></Button>
  </div>
</template>

<style scoped>
.label-with-button {
  display: flex;
  justify-content: space-between;
}
</style>