Merges the full git history of Inventory_frontend into the monorepo under frontend/. Removes the submodule in favor of a unified repo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
68 lines
1.6 KiB
Vue
68 lines
1.6 KiB
Vue
<template>
|
|
<div class="flex flex-col gap-4 md:flex-row md:items-start md:justify-between">
|
|
<div class="flex flex-col gap-2">
|
|
<h1 class="text-3xl font-bold">
|
|
{{ title }}
|
|
</h1>
|
|
</div>
|
|
<div class="flex items-center gap-2 print:hidden" data-print-hide>
|
|
<button
|
|
@click="$emit('toggle-edit')"
|
|
class="btn btn-primary"
|
|
:class="{ 'btn-outline': isEditMode }"
|
|
>
|
|
<IconLucideSquarePen
|
|
v-if="!isEditMode"
|
|
class="w-5 h-5 mr-2"
|
|
aria-hidden="true"
|
|
/>
|
|
<IconLucideEye
|
|
v-else
|
|
class="w-5 h-5 mr-2"
|
|
aria-hidden="true"
|
|
/>
|
|
{{ isEditMode ? 'Voir détails' : 'Modifier' }}
|
|
</button>
|
|
<button
|
|
v-if="!isEditMode"
|
|
@click="$emit('open-print')"
|
|
type="button"
|
|
class="btn btn-outline btn-secondary"
|
|
>
|
|
<IconLucidePrinter class="w-5 h-5 mr-2" aria-hidden="true" />
|
|
Imprimer
|
|
</button>
|
|
<button type="button" class="btn btn-ghost btn-sm md:btn-md" @click="goBack">
|
|
Retour aux machines
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import IconLucideSquarePen from '~icons/lucide/square-pen'
|
|
import IconLucideEye from '~icons/lucide/eye'
|
|
import IconLucidePrinter from '~icons/lucide/printer'
|
|
|
|
const router = useRouter()
|
|
|
|
defineProps<{
|
|
title: string
|
|
isEditMode: boolean
|
|
}>()
|
|
|
|
defineEmits<{
|
|
'toggle-edit': []
|
|
'open-print': []
|
|
}>()
|
|
|
|
function goBack() {
|
|
if (window.history.length > 1) {
|
|
router.back()
|
|
}
|
|
else {
|
|
navigateTo('/machines')
|
|
}
|
|
}
|
|
</script>
|