Skip to content

Commit 56eeb24

Browse files
authored
fix: page header merge conflict (#6816)
1 parent 68f4b5d commit 56eeb24

1 file changed

Lines changed: 43 additions & 31 deletions

File tree

  • packages/ui/src/layouts/shared/browse-tab

‎packages/ui/src/layouts/shared/browse-tab/header.vue‎

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import type { Component } from 'vue'
44
import { computed, ref } from 'vue'
55
import { useRouter } from 'vue-router'
66
7+
import Admonition from '#ui/components/base/Admonition.vue'
8+
import Avatar from '#ui/components/base/Avatar.vue'
9+
import ButtonStyled from '#ui/components/base/ButtonStyled.vue'
710
import PageHeader from '#ui/components/base/page-header/index.vue'
11+
import PageHeaderMetadata from '#ui/components/base/page-header/metadata/index.vue'
12+
import PageHeaderMetadataItem from '#ui/components/base/page-header/metadata/page-header-metadata-item.vue'
813
import LoaderIcon from '#ui/components/servers/icons/LoaderIcon.vue'
914
import { useServerImage } from '#ui/composables/use-server-image'
1015
import { formatLoaderLabel } from '#ui/utils/loaders'
@@ -46,34 +51,6 @@ const iconSrc = computed(() => {
4651
return fetchedIcon.value ?? installContext.value?.iconSrc ?? null
4752
})
4853
49-
const leadingItems = computed(() => {
50-
const context = installContext.value
51-
if (!context) return []
52-
53-
return [
54-
{
55-
id: 'back',
56-
type: 'button' as const,
57-
icon: LeftArrowIcon,
58-
ariaLabel: context.backLabel,
59-
tooltip: context.backLabel,
60-
onClick: handleBack,
61-
},
62-
...(iconSrc.value
63-
? [
64-
{
65-
id: 'icon',
66-
type: 'avatar' as const,
67-
src: iconSrc.value,
68-
alt: context.name,
69-
avatarSize: '48px',
70-
class: 'shrink-0',
71-
},
72-
]
73-
: []),
74-
]
75-
})
76-
7754
const metadataItems = computed(() => {
7855
const context = installContext.value
7956
if (!context) return []
@@ -162,13 +139,48 @@ async function handleSelectedProjectsLeaveResult(
162139
/>
163140
<PageHeader
164141
:title="installContext.name"
165-
:leading="leadingItems"
166-
:metadata="metadataItems"
167142
:divider="props.divider ?? false"
168143
:bottom-padding="props.bottomPadding ?? false"
169144
main-class="items-center"
170145
title-class="leading-8"
171146
truncate-title
172-
/>
147+
>
148+
<template #leading>
149+
<ButtonStyled circular size="large">
150+
<button
151+
v-tooltip="installContext.backLabel"
152+
type="button"
153+
:aria-label="installContext.backLabel"
154+
@click="handleBack"
155+
>
156+
<LeftArrowIcon />
157+
</button>
158+
</ButtonStyled>
159+
<Avatar
160+
v-if="iconSrc"
161+
:src="iconSrc"
162+
:alt="installContext.name"
163+
size="48px"
164+
class="shrink-0"
165+
/>
166+
</template>
167+
168+
<template v-if="metadataItems.length" #metadata>
169+
<PageHeaderMetadata>
170+
<PageHeaderMetadataItem
171+
v-for="item in metadataItems"
172+
:key="item.id"
173+
:icon="item.icon"
174+
:icon-props="item.iconProps"
175+
:class="item.class"
176+
>
177+
{{ item.label }}
178+
</PageHeaderMetadataItem>
179+
</PageHeaderMetadata>
180+
</template>
181+
</PageHeader>
182+
<Admonition v-if="installContext.warning" type="warning" class="mb-1">
183+
{{ installContext.warning }}
184+
</Admonition>
173185
</template>
174186
</template>

0 commit comments

Comments
 (0)