import Header from "@components/header/header" import PageSeo from "@components/page-seo" import VisibilityBadge from "@components/visibility-badge" import DocumentComponent from '@components/view-document' import styles from './post-page.module.css' import homeStyles from '@styles/Home.module.css' import type { File, Post } from "@lib/types" import { Page, Button, Text } from "@geist-ui/core" type Props = { post: Post } const PostPage = ({ post }: Props) => { const download = async () => { const downloadZip = (await import("client-zip")).downloadZip const blob = await downloadZip(post.files.map((file: any) => { return { name: file.title, input: file.content, lastModified: new Date(file.updatedAt) } })).blob() const link = document.createElement("a") link.href = URL.createObjectURL(blob) link.download = `${post.title}.zip` link.click() link.remove() } return (
{/* {!isLoading && } */}
{post.title}
{post.files.map(({ id, content, html, title }: File) => ( ))}
) } export default PostPage