import React from "react"; import { Formik } from "formik"; import axios from "axios"; import Head from "next/head"; import { TextInput, TextareaInput, SelectInput, } from "../components/forms/formfields.jsx"; import { ContactSchema } from "../components/forms/schemas.jsx"; export default class Kontakt extends React.Component { constructor(props) { super(props); this.state = { res: null, status: null, }; } render() { return ( <> Kontakt - Prothmann GmbH

Kontakt

Nutzen Sie einfach das Kontaktformular auf dieser Seite oder eine der untern angegebenen Kontaktmöglichkeiten.
Telefonisch erreichen Sie uns Montag - Freitag von 9:00 Uhr bis 16:00 Uhr.

E-Mail:{" "} info@prothmann.com
Telefon: +49 (0) 8142 59951
Fax: +49 (0) 8142 59953

Anschrift:
Industriestraße 6
82194 Gröbenzell (bei München)

{ console.log(values); const data = values; try { const res = await axios({ method: "post", url: "/api/contactsend", headers: { "Content-Type": "application/json", }, data, }); this.setState({ status: "Ihre Nachricht wurde erfolgreich versendet", res: res.status, }); } catch (error) { this.setState({ status: "Beim versenden ist ein Fehler aufgetreten! Bitte versuchen Sie es in einigen Minuten noch einmal oder schicken Sie und direkt eine e-Mail.", res: res.status, }); } console.log("State: ", this.state); }} > {({ values, errors, touched, handleChange, handleBlur, handleSubmit, isSubmitting, }) => (

{this.state.status}

{!isSubmitting && this.state.res != 200 && ( )} {isSubmitting && (
Sende...
)}
)}
); } }