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

export default async function FeedFollowingPage() {
	const res = await fetchTimeline(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/timeline"
				emptyMessage="팔로우한 크리에이터의 글이 없습니다. 채널을 팔로우해보세요."
			/>
		</>
	);
}
