mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-15 09:50:48 +02:00
Add "TrangaPage" composable
This commit is contained in:
36
website/app/components/TrangaPage.vue
Normal file
36
website/app/components/TrangaPage.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<UPageBody v-bind="$props" class="mt-0 pb-0 pr-4 h-full">
|
||||
<div class="flex flex-row gap-4 h-full relative">
|
||||
<div v-if="$slots.left" class="flex flex-col gap-2 bg-elevated w-1/5 h-full pl-4 py-4">
|
||||
<slot name="left" />
|
||||
</div>
|
||||
<div :class="['flex flex-col gap-2 w-full py-4 relative', $slots.left ? '' : 'pl-4']">
|
||||
<div class="w-full flex flex-row justify-between mb-4">
|
||||
<div class="flex flex-row gap-6">
|
||||
<UButton variant="outline" color="neutral" :to="back?.href ?? '/'" :icon="back?.icon ?? 'i-lucide-home'">{{
|
||||
back?.text ?? 'Home'
|
||||
}}</UButton>
|
||||
<slot name="title">
|
||||
<p v-if="title" class="text-2xl text-primary font-semibold">{{ title }}</p>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="flex flew-row gap-2">
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</UPageBody>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { PageBodyProps } from '#ui/components/PageBody.vue';
|
||||
|
||||
export interface PageProps extends PageBodyProps {
|
||||
title?: string;
|
||||
back?: { href?: string; text?: string; icon?: string };
|
||||
}
|
||||
|
||||
defineProps<PageProps>();
|
||||
</script>
|
Reference in New Issue
Block a user