import { useState, useEffect } from 'react'; import Navbar from '../components/navbar'; import { FormEvent } from 'react'; import { ArticleMeta } from './post/[id]'; import Tags from '../components/tag' import SearchOutlinedIcon from '@material-ui/icons/SearchOutlined'; function SearchBar(props: { searchFunction: (event?: FormEvent) => void; }) { return
} interface Post { title: string subtitle: string author: string date: string urlname: string tags: Array } interface PostsInfo { valid_tags: Array posts: Array } function Post(props: { post: Post }) { return {props.post.title} {props.post.subtitle &&

{props.post.subtitle}

}

Written by {props.post.author} on {new Date(props.post.date).toLocaleString("en-us", { month: "long", day: "numeric" })}

; } function Posts(props: { posts: Array }) { return
{ props.posts.map(post => ) }
; } export default function SearchPage() { var [posts, setPosts] = useState({ posts: [], valid_tags: [] }); useEffect(() => {(async () => { var posts = await fetch("/posts.json"); setPosts(await posts.json()); })()}, []); return

Search for posts

) => { event?.preventDefault(); }}/>
}