frontpage/components/Blog/ContentPage.tsx

24 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-10-15 22:17:51 +02:00
import type { NextPage } from "next";
2022-10-23 14:58:25 +02:00
import { Git } from "@icons-pack/react-simple-icons";
import Icon from "@mdi/react";
import { mdiWeb } from "@mdi/js";
2022-10-15 22:17:51 +02:00
import type { ProjectRender, DiaryRender } from "../../lib/content/types";
import DiaryPageSelector from "./DiaryPageSelector";
2022-10-18 14:07:33 +02:00
import styles from "../../styles/Blog/Content.module.scss";
2022-10-15 22:17:51 +02:00
const ContentPage: NextPage<{ content: ProjectRender | DiaryRender }> = ({ content }) => {
return (<>
2022-10-18 14:05:45 +02:00
{content.type === "diary" ? <DiaryPageSelector title={content.title} pageSelected={content.pageSelected} name={content.name} pages={content.entries} /> : null}
2022-10-23 14:58:25 +02:00
<div className={styles.more}>
{content.more ? <a href={content.more} className={"nostyle"}><Icon path={mdiWeb} size={"2em"} title="More" /></a> : null}
{content.repo ? <a href={content.repo} className={"nostyle"}><Git size={"2em"} title={"Repository"} /></a> : null}
</div>
2022-10-18 14:07:33 +02:00
<div className={styles.asciidoc} dangerouslySetInnerHTML={{ __html: content.html }}>
2022-10-15 22:17:51 +02:00
</div>
2022-10-18 14:05:45 +02:00
{content.type === "diary" ? <DiaryPageSelector title={content.title} pageSelected={content.pageSelected} name={content.name} pages={content.entries} bottom /> : null}
2022-10-15 22:17:51 +02:00
</>);
};
export default ContentPage;