import React from 'react';
import { Head, Link, useForm, usePage } from '@inertiajs/react';
import { useTranslation } from 'react-i18next';
import MarketingLayout from '@/layouts/marketing/MarketingLayout';
const Kontakt: React.FC = () => {
const { data, setData, post, processing, errors, reset } = useForm({
name: '',
email: '',
message: '',
});
const { flash } = usePage().props as any;
const { t } = useTranslation('marketing');
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
post('/kontakt', {
onSuccess: () => reset(),
});
};
React.useEffect(() => {
if (Object.keys(errors).length > 0) {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}, [errors]);
return (
{t('kontakt.description')}
{flash?.success &&{flash.success}
} {Object.keys(errors).length > 0 && (