<!-- Used as Attach & Attach Image Control -->
<script setup>
import { t } from '@/shared/i18n';

const props = defineProps(["df"]);
</script>

<template>
  <div class="control editable">
    <!-- label -->
    <div class="field-controls">
      <slot name="label" />
      <slot name="actions" />
    </div>

    <!-- attach button -->
    <button class="btn btn-sm btn-default">{{ t("Attach") }}</button>

    <!-- description -->
    <div v-if="df.description" class="mt-2 description" v-html="df.description"></div>
  </div>
</template>

<style lang="scss" scoped>
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #f3f4f6;
  cursor: pointer;
  font-size: 13px;
  
  &:hover {
    background-color: #e5e7eb;
  }
}

.description {
  font-size: 12px;
  color: #6b7280;
}

.mt-2 {
  margin-top: 0.5rem;
}
</style>
