import { fetchJson } from '@/lib/utils/server';
import type { CreatorListResponse } from '@/types/response/channel/creators';
import CreatorExplorer from './CreatorExplorer';

export const metadata = {
	title: '크리에이터'
};

export default async function CreatorsPage()
{
	const res = await fetchJson<CreatorListResponse>('/api/channel/creators', { method: 'GET' });
	const creators = res.success && res.data ? res.data.creators : [];

	return (
		<div className="mx-auto w-full px-4 py-6">
			<CreatorExplorer creators={creators} />
		</div>
	);
}