import { fetchForYou } from '@/lib/api/feed/feed';
import FeedList from '../_component/FeedList';
import FeedTabs from '../_component/FeedTabs';
import FeedWriteButton from '../_component/FeedWriteButton';

export default async function FeedForYouPage() {
	const res = await fetchForYou(1, 20);
	const data = res.data ?? { total: 0, list: [] };

	return (
		<>
			<header className="feed__header">
				<FeedTabs />
				<FeedWriteButton />
			</header>

			<FeedList
				initialCards={data.list}
				initialTotal={data.total}
				endpoint="/api/feed/foryou"
				emptyMessage="추천 피드가 비어 있습니다. 조금 더 활동해보세요."
			/>
		</>
	);
}