import styles from "./styles.module.scss"
import { Worship as WorshipType } from '@/payload-types'
import { useDate } from '@/hooks/useCompactDate'
import { Section } from '@/components/Section/Section'
import { Title } from '@/components/Title/Title'
import { liturgicalDayName } from '@/hooks/liturgicalDayName'
import { EventExcerpt, EventExcerptRow } from '@/components/EventExcerpt/EventExcerpt'
import { transformCategory } from '@/utils/dto/worship'
import { TextDiv } from '@/components/Text/TextDiv'
import { church } from '@/utils/church'
import { ChurchIcon } from '@/components/ChurchIcon/ChurchIcon'
import { Cross } from '@/components/Cross/Cross'
import { Testimony } from '@/components/Testimony/Testimony'
type WorshipPageProps = {
worship: WorshipType
}
export const Worship = ({ worship }: WorshipPageProps) => {
const date = new Date(worship.date);
const day = date.toLocaleDateString('de-DE', {weekday: 'long'} )
const localeDate = useDate(worship.date)
const liturgicalDay = worship.liturgicalDay ? worship.liturgicalDay : liturgicalDayName(worship.date);
const what = worship.title ? worship.title : transformCategory(worship.type);
const time = date.toLocaleTimeString("de-DE", { timeStyle: "short", timeZone: "Europe/Berlin" });
return (
<>
{what}
{ typeof worship.location == "object" &&
}
{ worship.celebrant &&
{worship.celebrant}
}
{ typeof worship.description === "string" && worship.description != "" &&
}
>
)
}