<template>
  <li :class="['uploaded-picture-item', look]">
    <div class="uploaded-information">
      <span v-if="itemUploadedText">{{ itemUploadedText }}</span>
    </div>
    <slot></slot>
  </li>
</template>

<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps({
  name: { type: String, default: '' },
  text: { type: String, default: '' },
  look: {
    type: String,
    validator: (value: string): boolean =>
      ['error', 'success', 'default'].includes(value),
    default: 'default'
  }
})

const itemUploadedText = computed<string | null>(
  () => `${props.name} - ${props.text}`
)
</script>

<style scoped lang="scss">
.uploaded-picture-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: toRem(1) toRem(2);
  margin-top: toRem(1);
  border-radius: toRem(0.5);
  width: 100%;
  @include text(s-regular);
}
.success {
  background-color: var(--white);
  border: toRem(0.1) solid var(--grey);
  color: var(--black);
}
.error {
  background-color: var(--white);
  border: toRem(0.1) solid var(--red-pale);
  color: var(--red);
}
.uploaded-information {
  margin-right: toRem(1);
}
</style>
