<template>
  <div class="grid grid-cols-1 items-start gap-6 md:grid-cols-2">
    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Simple</h2>
      <MalioTime v-model="simpleValue" />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Avec label</h2>
      <MalioTime
        v-model="labeledValue"
        label="Heure de depart"
        name="departure-time"
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Valeur initiale</h2>
      <MalioTime
        v-model="initialValue"
        label="Heure d'arrivee"
        hint="Format HH:MM"
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Required</h2>
      <MalioTime
        v-model="requiredValue"
        label="Heure limite"
        required
        hint="Champ obligatoire"
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Desactive</h2>
      <MalioTime
        v-model="disabledValue"
        label="Heure verrouillee"
        disabled
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Readonly</h2>
      <MalioTime
        v-model="readonlyValue"
        label="Heure en lecture seule"
        readonly
        hint="Visible mais non modifiable"
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Erreur</h2>
      <MalioTime
        v-model="errorValue"
        label="Heure de fermeture"
        error="L'heure saisie n'est pas valide"
      />
    </div>

    <div class="rounded-lg border p-4">
      <h2 class="mb-4 text-xl font-bold">Succes</h2>
      <MalioTime
        v-model="successValue"
        label="Heure confirmee"
        success="Horaire enregistre"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'
import MalioTime from '../../../../app/components/malio/time/Time.vue'

const simpleValue = ref('')
const labeledValue = ref('')
const initialValue = ref('08:30')
const requiredValue = ref('')
const disabledValue = ref('14:15')
const readonlyValue = ref('18:45')
const errorValue = ref('25:90')
const successValue = ref('09:00')
</script>
