import React from 'react';
import LinkManager from 'modularity-front';
import Modularity from 'modularity-front';
import {Row, Footer } from 'react-materialize';

import Embed from './UserInputs/Embed';
import './Footer.css';
const Module = Modularity.Module;
const Link = LinkManager.Modules.Link;


class FooterModule extends Modularity.Module {
	constructor(props) {
        super(props);
		this.state = {
        }        
    }


    render(){
        let footLinks = this.FooterLinkHeaders.value.map((item,index)=>{
            return(
                <li key={index}>
                    <Link link={this.FooterLinks.value[index] || ""} className="grey-text text-lighten-3">
                    {item}
                    </Link>
                </li>
            )
        })

        return(
            <div>
                <Footer copyrights={<Embed className="copy" html={this.FooterCopyright.value} />}
                moreLinks={<Embed className="company" html={this.FooterCompany.value} />}
                links={
                    <ul>
                        {footLinks}
                    </ul>
                }
                className={this.FooterStyle.value} >
                    <h5 className="white-text">{this.FooterHeader.value}</h5>
    			    <div className="grey-text text-lighten-4">
                        <Embed html={this.FooterContent.value} />
                    </div>
                </Footer>
                {super.render()}
            </div>
        )
    }

}

FooterModule.Inputs = {
    FooterHeader:{
        type:Module.Types.Text,
        defaultValue:"Footer Header"
    },
    FooterLinkHeaders:{
        type:Module.Types.Array,
        defaultValue:["Home","There","Somewhere","Route"],
        arrType:Module.Types.Text
    },
    FooterLinks: {
        type:Module.Types.Array,
        defaultValue:["home","there","somewhere","route"],
        arrType:Module.Types.Text
    },
    FooterCopyright:{
        type:Module.Types.Text,
        defaultValue:"&copy 2015 Copyright Text"
        },
    FooterCompany:{
        type:Module.Types.Text,
        defaultValue:"Constructed By Nikos Atlas & Konstantinos Schoinas  "
        },
    FooterContent: {
        type:Module.Types.Text,
        defaultValue:"You can use rows and columns here to organize your footer content."
    },
    FooterStyle:{
        type:Module.Types.Text,
        defaultValue:"blue-grey darken-1"
    },

}



FooterModule.EditPosition = "bottom-right";
FooterModule.Category = "sxoinas";


export default FooterModule;