import { Worship } from '@/payload-types'
import { MassTable } from '@/components/MassTable/MassTable'
import styles from './massgrid.module.scss'

export type MassGridLocation = {
  id: string
  name: string
  masses: Worship[]
}

type MassGridProps = {
  locations: MassGridLocation[]
}

export const MassGrid = ({ locations }: MassGridProps) => {
  return (
    <div className={styles.container}>
      <div className={styles.grid}>
        {locations.map((location) => (
          <MassTable
            key={location.id}
            location={location.name}
            masses={location.masses}
          />
        ))}
      </div>
    </div>
  )
}
