import React, { Component } from 'react'


export default class CompanyInfo extends Component {
  // todo: SearchPage
  // searchBox = {
  //   "@context": "http://schema.org",
  //   "@type": "WebSite",
  //   "url": "https://digital812.su/",
  //   "potentialAction": {
  //     "@type": "SearchAction",
  //     "target": "https://digital812.su/search?q={search_term_string}",
  //     "query-input": "required name=search_term_string"
  //   }
  // };

  constructor(props) {
    super(props);
    const organisation = {
        "@context": "http://schema.org",
        "@type": "Organization",
        "url": "https://digital812.su",
        "logo": "https://digital812.su/logo.jpg",
        "contactPoint": [{
          "@type": "ContactPoint",
          "telephone": "+7-812-806-88-30",
          "contactType": "customer service"
        }]
      },
      alternativeName = {
        "@context": "http://schema.org",
        "@type": "WebSite",
        "name": "digital812",
        "alternateName": "digital812.su",
        "url": "https://digital812.su"
      },
      socialData = {
        "@context": "http://schema.org",
        "@type": "Person",
        "name": "digital812",
        "url": "https://digital812.su",
        "sameAs": [
          "https://www.facebook.com/digital812",
          "https://instagram.com/digital812.su",
          "https://vk.com/digital812",
        ]
      };
    this.data = [
      organisation, alternativeName,
      socialData
    ].map(item => JSON.stringify(item));
  }

  render() {
    const { data } = this;

    return (
      <div>
        {data.map((__html, key) => (
          <script type="application/ld+json" key={key}
                  dangerouslySetInnerHTML={{__html}}/>
        ))}
      </div>
    )
  }
}

