mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
---
|
|
// Layout front-matter flags are plain props here.
|
|
// TODO: layout-navbar-overlap && layout-navbar-dark → extra text-white class
|
|
// on .page-header — both unset on the homepage.
|
|
import HeaderProfile from './HeaderProfile.astro';
|
|
import HeaderUptime from './HeaderUptime.astro';
|
|
import PageTitle from '@ui/PageTitle.astro';
|
|
|
|
interface Props {
|
|
/** page-header — the page title; without it the whole block is not rendered */
|
|
title?: string | undefined;
|
|
/** page-header-pretitle */
|
|
pretitle?: string | undefined;
|
|
/** page-header-description */
|
|
description?: string | undefined;
|
|
/** page-header-class */
|
|
class?: string;
|
|
/** page-header-file — name of an include from layout/headers/, e.g. "profile" */
|
|
file?: string | undefined;
|
|
/** layout-navbar-overlap && layout-navbar-dark → text-white on .page-header */
|
|
textWhite?: boolean | undefined;
|
|
}
|
|
|
|
const { title, pretitle, description, class: className, file, textWhite } = Astro.props;
|
|
|
|
const actionsSlot = ((await Astro.slots.render('actions')) ?? '').trim();
|
|
---
|
|
|
|
{file === 'profile' && <HeaderProfile />}
|
|
{file === 'uptime' && <HeaderUptime />}
|
|
{
|
|
!file && title && (
|
|
<div class={`page-header${className ? ` ${className}` : ''} d-print-none${textWhite ? ' text-white' : ''}`}>
|
|
<div class="container-xl">
|
|
<div class="row g-2 align-items-center">
|
|
<div class="col">
|
|
{pretitle && (
|
|
<Fragment>
|
|
<!-- Page pre-title -->
|
|
<div class="page-pretitle">{pretitle}</div>
|
|
</Fragment>
|
|
)}
|
|
<PageTitle>
|
|
{title}
|
|
</PageTitle>
|
|
|
|
{description && <div class="text-secondary mt-1">{description}</div>}
|
|
</div>
|
|
|
|
{actionsSlot && (
|
|
<Fragment>
|
|
<!-- Page title actions -->
|
|
<div class="col-auto ms-auto d-print-none">
|
|
<Fragment set:html={actionsSlot} />
|
|
</div>
|
|
</Fragment>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|