import Layout from '@/app/component/Layout'; import { fetchJson } from '@/lib/utils/server'; import { ChannelListResponse } from '@/types/response/channel/list'; import { ChannelListItem } from '@/types/channel'; export default async function MainLayout({ children }: { children: React.ReactNode }) { const res = await fetchJson('/api/channel/list'); const initialChannels: ChannelListItem[] = (res.data?.channels ?? []).map((ch, idx) => ({ ...ch, _offlineRank: idx })); return ( {children} ); }