import dreikoenige from '../../sites/dreikoenige/config'
import chemnitz from '../../sites/chemnitz/config'

export type FontKey =
  | 'cairo'
  | 'roboto'
  | 'openSans'
  | 'lato'
  | 'nunito'
  | 'raleway'
  | 'faustina'
  | 'merriweather'
  | 'sourceSans3'
  | 'playfairDisplay'
  | 'lora'
  | 'crimsonText'
  | 'ebGaramond'

export interface SiteConfig {
  id: string
  name: string
  shortName: string
  description: string
  url: string
  email: string
  address: string
  postalCode: string
  city: string
  phone: string
  keywords: string[]
  ogImage: string
  baseColor: string
  shade1: string
  shade2: string
  shade3: string
  contrastColor: string
  contrastShade1: string
  defaultFont: FontKey
  headerFont: FontKey
  borderRadius: string
  magazineName: string
}

const sites: Record<string, SiteConfig> = {
  dreikoenige,
  chemnitz,
}

const siteId = process.env.NEXT_PUBLIC_SITE_ID || 'dreikoenige'

const config = sites[siteId]
if (!config) {
  throw new Error(
    `Unknown SITE_ID "${siteId}". Available: ${Object.keys(sites).join(', ')}`,
  )
}

export const siteConfig: SiteConfig = config
