---
import { SERVICE_TIMES } from '../lib/constants.js';
import {
getChurchName,
getChurchPhysicalAddress,
getChurchPoBox,
getContactPhone,
getContactEmail,
getFacebookUrl,
getYoutubeUrl,
getInstagramUrl,
getMissionStatement
} from '../lib/bindings.js';
let churchName = 'Church';
let physicalAddress = '';
let poBox = '';
let phone = '';
let email = '';
let facebookUrl = '';
let youtubeUrl = '';
let instagramUrl = '';
let missionStatement = '';
try {
churchName = getChurchName();
physicalAddress = getChurchPhysicalAddress();
poBox = getChurchPoBox();
phone = getContactPhone();
// Get the base email from church-core and make it dynamic based on current domain
const baseEmail = getContactEmail();
const currentUrl = Astro.url.hostname;
// Extract the domain part and create dynamic email
if (currentUrl && currentUrl !== 'localhost') {
email = `admin@${currentUrl}`;
} else {
// Fallback to the original email from church-core
email = baseEmail;
}
facebookUrl = getFacebookUrl();
youtubeUrl = getYoutubeUrl();
instagramUrl = getInstagramUrl();
missionStatement = getMissionStatement();
} catch (e) {
console.error('Failed to get church config:', e);
}
const currentYear = new Date().getFullYear();
---