import type { GetServerSideProps } from 'next'
import HomePage from '@/components/home/HomePage'
import {
  type ExplorerRecentActivitySnapshot,
  type ExplorerStats,
  type ExplorerTransactionTrendPoint,
} from '@/services/api/stats'
import {
  type MissionControlBridgeStatusResponse,
  type MissionControlRelaySummary,
} from '@/services/api/missionControl'
import type { Block } from '@/services/api/blocks'
import type { Transaction } from '@/services/api/transactions'

interface IndexPageProps {
  initialStats: ExplorerStats | null
  initialRecentBlocks: Block[]
  initialRecentTransactions: Transaction[]
  initialTransactionTrend: ExplorerTransactionTrendPoint[]
  initialActivitySnapshot: ExplorerRecentActivitySnapshot | null
  initialBridgeStatus: MissionControlBridgeStatusResponse | null
  initialRelaySummary: MissionControlRelaySummary | null
}

export default function IndexPage(props: IndexPageProps) {
  return <HomePage {...props} />
}

export const getServerSideProps: GetServerSideProps<IndexPageProps> = async () => ({
  props: {
    initialStats: null,
    initialRecentBlocks: [],
    initialRecentTransactions: [],
    initialTransactionTrend: [],
    initialActivitySnapshot: null,
    initialBridgeStatus: null,
    initialRelaySummary: null,
  },
})
