diff --git a/src/app/explore/page.tsx b/src/app/explore/page.tsx
index 59ca59e..00725a0 100644
--- a/src/app/explore/page.tsx
+++ b/src/app/explore/page.tsx
@@ -2,7 +2,9 @@
import { useState, useEffect } from 'react';
import Link from 'next/link';
-import { SearchIcon, TrendingIcon, UsersIcon, HeartIcon, RepeatIcon, MessageIcon } from '@/components/Icons';
+import { SearchIcon, TrendingIcon, UsersIcon } from '@/components/Icons';
+import { PostCard } from '@/components/PostCard';
+import { Post } from '@/lib/types';
interface User {
id: string;
@@ -14,99 +16,6 @@ interface User {
isRemote?: boolean;
}
-interface MediaItem {
- id: string;
- url: string;
- altText?: string | null;
-}
-
-interface Post {
- id: string;
- content: string;
- createdAt: string;
- likesCount: number;
- repostsCount: number;
- repliesCount: number;
- author: User;
- media?: MediaItem[];
-}
-
-
-
-function PostCard({ post }: { post: Post }) {
- const [liked, setLiked] = useState(false);
- const [reposted, setReposted] = useState(false);
-
- const formatTime = (dateStr: string) => {
- const date = new Date(dateStr);
- const now = new Date();
- const diff = now.getTime() - date.getTime();
- const minutes = Math.floor(diff / 60000);
- const hours = Math.floor(minutes / 60);
- const days = Math.floor(hours / 24);
-
- if (minutes < 1) return 'now';
- if (minutes < 60) return `${minutes}m`;
- if (hours < 24) return `${hours}h`;
- if (days < 7) return `${days}d`;
- return date.toLocaleDateString();
- };
-
- const handleLike = async () => {
- setLiked(!liked);
- await fetch(`/api/posts/${post.id}/like`, { method: 'POST' });
- };
-
- const handleRepost = async () => {
- setReposted(!reposted);
- await fetch(`/api/posts/${post.id}/repost`, { method: 'POST' });
- };
-
- return (
-
- ) : (
- post.author.displayName?.charAt(0).toUpperCase() || post.author.handle.charAt(0).toUpperCase()
- )}
-
-