54 lines
1.6 KiB
Vue
54 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { Link, usePage } from '@inertiajs/vue3'
|
|
|
|
const { props } = usePage<{ component: any }>()
|
|
const { component } = props
|
|
const originHeader = { 'X-Inertia-Origin': 'components' }
|
|
</script>
|
|
|
|
<template>
|
|
<div class="max-w-2xl mx-auto p-8 bg-white shadow-lg rounded-lg">
|
|
<h1 class="text-2xl font-semibold mb-8 text-gray-800">Component Details</h1>
|
|
|
|
<div class="mb-6">
|
|
<label class="block text-gray-700 text-sm font-bold mb-2" for="name">Name</label>
|
|
<div class="px-3 py-2 border rounded text-gray-700" id="name">
|
|
{{ component.name }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label class="block text-gray-700 text-sm font-bold mb-2" for="price">Price</label>
|
|
<div class="px-3 py-2 border rounded text-gray-700" id="price">${{ component.price }}</div>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label class="block text-gray-700 text-sm font-bold mb-2" for="type">Type</label>
|
|
<div class="px-3 py-2 border rounded text-gray-700" id="type">
|
|
{{ component.type.name }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-6">
|
|
<label class="block text-gray-700 text-sm font-bold mb-2" for="purchaseDate"
|
|
>Purchase Date</label
|
|
>
|
|
<div class="px-3 py-2 border rounded text-gray-700" id="purchaseDate">
|
|
{{ component.purchaseDate }}
|
|
</div>
|
|
</div>
|
|
|
|
<Link
|
|
:href="`/components/${component.id}/edit`"
|
|
type="button"
|
|
as="button"
|
|
class="w-full md:w-auto px-4 py-2 bg-indigo-600 text-white rounded hover:bg-blue-700 transition text-center"
|
|
:headers="originHeader"
|
|
>
|
|
Edit
|
|
</Link>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|