import { Link, useParams } from 'react-router-dom'; import { getAuthor } from '../api'; import { useAsync } from '../lib/useAsync'; import PostCard from '../components/PostCard'; export default function AuthorPage() { const { name = '' } = useParams(); const { data: author, loading, error } = useAsync(() => getAuthor(name), [name]); if (loading) return
Loading…
; if (error || !author) { return (See all authors.