import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server"

import SurprisesClient from "./Client"

export default async function Surprises() {
  if (!env.ENABLE_SURPRISES) {
    return null
  }

  const caller = await serverClient()
  const surprises = await caller.contentstack.rewards.surprises()

  if (!surprises) {
    return null
  }

  return <SurprisesClient surprises={surprises} />
}
