- Remove non-functional search bar, notifications and settings buttons from header - Remove leftover console.log and unused useAttrs import in sidebar - Remove unused scoped CSS in computers/index.vue (Tailwind-only template) - Regenerate database/schema.ts after running migrations locally - Ignore .serena/ local tooling directory - Refresh package-lock.json after npm install
47 lines
1.5 KiB
Vue
47 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { Link } from '@adonisjs/inertia/vue'
|
|
|
|
defineProps<{ computers: any[] }>()
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div class="flex justify-between items-center">
|
|
<h3 class="text-3xl font-semibold text-gray-700">Computers</h3>
|
|
|
|
<Link
|
|
href="/computers/create"
|
|
type="button"
|
|
as="button"
|
|
class="inline-flex shrink-0 px-4 py-2 bg-indigo-600 text-white rounded hover:bg-blue-700 transition"
|
|
>
|
|
Add
|
|
</Link>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
<template v-if="computers.length > 0">
|
|
<div
|
|
v-for="computer in computers"
|
|
:key="computer.id"
|
|
class="p-4 border rounded-lg shadow hover:shadow-lg transition"
|
|
>
|
|
<h4 class="font-semibold text-lg text-gray-800">{{ computer.title }}</h4>
|
|
<p class="text-gray-600">State: {{ computer.state?.name }}</p>
|
|
<p class="text-indigo-600 font-semibold">Price: ${{ computer.sellPrice }}</p>
|
|
<p class="text-gray-500 text-sm">{{ computer.components.length }} components</p>
|
|
<Link
|
|
:href="`/computers/${computer.id}`"
|
|
class="mt-2 inline-block text-indigo-600 hover:text-indigo-700"
|
|
>
|
|
View Details
|
|
</Link>
|
|
</div>
|
|
</template>
|
|
<template v-else>
|
|
<p class="text-gray-500">No computers yet. Create one to get started!</p>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|