add backHref prop to CrewHeader, fix title alignment
This commit is contained in:
parent
e1d8c92a5b
commit
5fb2331958
1 changed files with 8 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from 'svelte'
|
import type { Snippet } from 'svelte'
|
||||||
|
import Button from '$lib/components/ui/Button.svelte'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** Main title text */
|
/** Main title text */
|
||||||
|
|
@ -10,18 +11,23 @@
|
||||||
subtitle?: string | undefined
|
subtitle?: string | undefined
|
||||||
/** Optional description text */
|
/** Optional description text */
|
||||||
description?: string | undefined
|
description?: string | undefined
|
||||||
|
/** Optional back navigation URL */
|
||||||
|
backHref?: string | undefined
|
||||||
/** Content rendered below title (e.g., filter tabs) */
|
/** Content rendered below title (e.g., filter tabs) */
|
||||||
belowTitle?: Snippet | undefined
|
belowTitle?: Snippet | undefined
|
||||||
/** Action buttons on the right */
|
/** Action buttons on the right */
|
||||||
actions?: Snippet | undefined
|
actions?: Snippet | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const { title, subtitle, description, belowTitle, actions }: Props = $props()
|
const { title, subtitle, description, backHref, belowTitle, actions }: Props = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<div class="header-info">
|
<div class="header-info">
|
||||||
<div class="title-row">
|
<div class="title-row">
|
||||||
|
{#if backHref}
|
||||||
|
<Button variant="ghost" size="small" iconOnly icon="arrow-left" href={backHref} />
|
||||||
|
{/if}
|
||||||
<span class="header-title">{title}</span>
|
<span class="header-title">{title}</span>
|
||||||
{#if subtitle}
|
{#if subtitle}
|
||||||
<span class="header-subtitle">[{subtitle}]</span>
|
<span class="header-subtitle">[{subtitle}]</span>
|
||||||
|
|
@ -61,7 +67,7 @@
|
||||||
|
|
||||||
.title-row {
|
.title-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: center;
|
||||||
gap: spacing.$unit;
|
gap: spacing.$unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue