2023-04-16 20:10:40 -04:00
|
|
|
import { PropsWithChildren } from "react";
|
2023-04-21 21:50:43 -04:00
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
import { faCalendar } from "@fortawesome/free-regular-svg-icons";
|
2023-04-16 20:10:40 -04:00
|
|
|
|
|
|
|
import Base from "../pages/LayoutBase";
|
|
|
|
|
|
|
|
interface BlogProps {
|
|
|
|
title: string;
|
|
|
|
description: string;
|
|
|
|
published: string;
|
|
|
|
updated?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function Layout({
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
published,
|
|
|
|
updated,
|
|
|
|
}: BlogProps): React.FC<PropsWithChildren> {
|
|
|
|
const header = (
|
|
|
|
<div className="header">
|
|
|
|
<h1>{title}</h1>
|
|
|
|
<h3>{description}</h3>
|
2023-04-21 21:50:43 -04:00
|
|
|
<h4>
|
|
|
|
<FontAwesomeIcon icon={faCalendar} />
|
|
|
|
{published}
|
|
|
|
</h4>
|
2023-04-16 20:10:40 -04:00
|
|
|
{updated && <p>Last updated: {updated}</p>}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
const withChildren: React.FC<PropsWithChildren> = ({ children }) => (
|
|
|
|
<Base>
|
|
|
|
{header}
|
2023-04-21 21:39:53 -04:00
|
|
|
<div style={{ paddingTop: "2em" }} />
|
2023-04-16 20:10:40 -04:00
|
|
|
{children}
|
|
|
|
</Base>
|
|
|
|
);
|
|
|
|
return withChildren;
|
|
|
|
}
|