<template>
    <div class="h-full overflow-auto">
        <div class="relative p-2.5 flex flex-col gap-5 h-72">
            <h3>Character details</h3>
            <button @click="toggle" class="btn-cyan px-4 py-1.5 w-24">Edit</button>
            <form class="flex gap-2.5 flex-wrap">
                <div class="form-field-half max-w-[300px]">
                    <label for="name">Name</label>
                    <input class="input-cyan" :class="{'inactive': !editCharacter}" type="text" name="name" placeholder="Ethereal" disabled />
                </div>
                <div class="form-field-half max-w-[300px]">
                    <label for="class">Class</label>
                    <input class="input-cyan" :class="{'inactive': !editCharacter}" type="text" name="class" placeholder="Knight" disabled />
                </div>
                <button v-if="editCharacter" @click="toggle" class="btn-cyan px-4 py-1.5 min-w-24" type="submit">Save</button>
            </form>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const editCharacter = ref(false)

const toggle = () => {
    editCharacter.value = !editCharacter.value
}
</script>