<template>
  <span class="color-swatch-outer">
    <span class="color-swatch-inner">
      <span class="color-swatch" :style="{ background: item.hexColor }"></span>
      {{ item.displayName }}
    </span>
  </span>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { ColorItem } from './color-picker.vue';

@Component
export default class ColorPickerItem extends Vue {
  @Prop(Object) item!: ColorItem;
}
</script>

<style lang="scss">
.color-swatch-outer {
  display: inline-block;
  vertical-align: top;

  .popover-body & {
    margin-left: 6px;
  }
}

.color-swatch-inner {
  display: flex;
}

.color-swatch {
  margin-left: -1px;
  margin-right: 4px;
  width: 24px;
  border: 1px solid rgba(#ccc, 0.7);
  border-radius: 0.25rem;
  vertical-align: middle;
}
</style>
