/* global React */
// Contact
const { useState } = React;
const NS_CT = window.GamekeepersCottageDesignSystem_070bc7;
const { Eyebrow, Button, Card, Input } = NS_CT;
const C = window.GKContact;
const submitEnquiry = window.GKsubmitEnquiry;
function Method({ icon, label, value, href }) {
const inner = (
);
return href ? {inner} : inner;
}
function ContactContent() {
const [sent, setSent] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [sendError, setSendError] = useState('');
const [form, setForm] = useState({ firstName: '', lastName: '', email: '', phone: '', arrive: '', depart: '', message: '', company: '' });
const set = (k) => (e) => setForm(f => ({ ...f, [k]: e.target.value }));
const submit = async (e) => {
e.preventDefault();
if (submitting) return;
setSendError(''); setSubmitting(true);
try {
await submitEnquiry({ type: 'contact', firstName: form.firstName, lastName: form.lastName, email: form.email, phone: form.phone, arrive: form.arrive, depart: form.depart, message: form.message, company: form.company });
setSent(true);
} catch (err) {
setSendError('Sorry — we couldn’t send that just now. Please call ' + C.PHONE + ', or email ' + C.EMAIL + '.');
} finally { setSubmitting(false); }
};
return (
Contact
Get in touch with Nick
Please don't hesitate to contact us — we'll gladly answer any questions about the cottage, the wood or getting here before you book.
Hi, I'm Nick — your host
The cottage was my family home as a teenager and we look after it ourselves. We keep it more like a home than a rental, and love sharing the wood with our guests.
{sent ? (
Message sent
Thank you — we'll reply as soon as we can, usually within a day.
) : (
)}
);
}
window.GKmount('contact', ContactContent);