---
import PageTitle from '../components/PageTitle.astro';

import GridLayout from './GridLayout.astro';

export interface Props {
	class?: string;
	frontmatter?: any;
	grid?: 'wide' | 'narrow';
}

const { frontmatter, class: className, grid = 'narrow' } = Astro.props;
const gridVariant = frontmatter.grid || grid;
---

<GridLayout grid={gridVariant} class={className} {...frontmatter}>
	<PageTitle slot="title" grid={gridVariant} {...frontmatter}>
		{frontmatter.title}
	</PageTitle>
	<slot name="before-content" />
	<slot />
	<slot name="after-content" />
</GridLayout>
