import React from 'react'; import { Link } from 'react-router-dom'; import { Post } from '../api/posts'; interface PostListProps { posts: Post[]; onDelete: (id: number) => void; } interface Tag { id: number; name: string; slug: string; } const PostList: React.FC = ({ posts, onDelete }) => { return (
{posts.map((post) => (

{post.title}

By {post.author.username} • {new Date(post.created_at).toLocaleDateString()}

{post.status.charAt(0).toUpperCase() + post.status.slice(1)} {post.tags.map((tag) => ( {tag.name} ))}
View Edit

{post.content}

))}
); }; export default PostList;