import React, {Component} from "react";
import {NewTickMessage} from "../types";
import {SidebarCard} from "./HCard";

export class Navbar extends Component<any, any> {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <nav
                className="w-24 flex flex-col items-center bg-gray-800 dark:bg-gray-800 py-4 my-1 rounded-tl rounded-bl">
                <div>
                    <a href={"#"} className={"flex flex-col items-center"}>
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
                             className={"text-white w-7 fill-current"}>
                            <path
                                d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"/>
                        </svg>
                    </a>

                </div>

                <ul className="mt-2 text-gray-700 dark:text-gray-400 capitalize">
                    {/* Links */}
                    <li className="mt-3 p-2 text-blue-600 dark:text-blue-300 rounded-lg">
                        <a href="#" className=" flex flex-col items-center">
                            <svg className="fill-current h-5 w-5" viewBox="0 0 24 24">
                                <path
                                    d="M19 5v2h-4V5h4M9 5v6H5V5h4m10 8v6h-4v-6h4M9
							17v2H5v-2h4M21 3h-8v6h8V3M11 3H3v10h8V3m10
							8h-8v10h8V11m-10 4H3v6h8v-6z"/>
                            </svg>
                            <span className="text-xs mt-2 text-gray-300">Dashboard</span>
                        </a>

                    </li>
                </ul>
            </nav>
        )
    }
}

export class Sidebar extends Component<NewTickMessage, any> {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <aside
                className="w-1/4 my-1 mr-1 pl-6 pr-2 py-4 flex flex-col bg-gray-200 dark:bg-black
		dark:text-gray-400 rounded-r-lg overflow-y-auto">

                <div className="flex flex-wrap justify-center">
                    <SidebarCard title={"Current price"} content={"$" + this.props.price.toFixed(2).toString()}/>
                    <SidebarCard title={"Current tick"} content={this.props.tick.toString()}/>
                </div>


                {/*    <button*/}
                {/*        className="mt-8 flex items-center py-4 px-3 text-white rounded-lg*/}
                {/*bg-green-400 shadow focus:outline-none">*/}
                {/*        /!*Action*!/*/}
                {/*        <svg className="h-5 w-5 fill-current mr-2 ml-3" viewBox="0 0 24 24">*/}
                {/*            <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>*/}
                {/*        </svg>*/}

                {/*        <span>Bill your Students</span>*/}

                {/*    </button>*/}

                {/*    <div className="mt-12 flex items-center">*/}
                {/*        /!*Payments*!/*/}
                {/*        <span>Payments</span>*/}
                {/*        <button className="ml-2 focus:outline-none">*/}
                {/*            <svg className="h-5 w-5 fill-current" viewBox="0 0 256 512">*/}
                {/*                <path*/}
                {/*                    d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9*/}
                {/*			0l-22.6-22.6c-9.4-9.4-9.4-24.6*/}
                {/*			0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3*/}
                {/*			103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1*/}
                {/*			34z"/>*/}
                {/*            </svg>*/}
                {/*        </button>*/}
                {/*    </div>*/}

                {/*    <a*/}
                {/*        href="/"*/}
                {/*        className="mt-8 p-4 flex justify-between bg-gray-300 rounded-lg*/}
                {/*font-semibold capitalize">*/}
                {/*        /!*Link*!/*/}
                {/*        <div className="flex">*/}

                {/*            <img*/}
                {/*                className="h-10 w-10 rounded-full object-cover"*/}
                {/*                src="https://lh3.googleusercontent.com/cX0xwvJKCNIFrl2wIwoYiIURxmZt1y7tF3wJvynqcnQG5tmYdKBLpDDvhXzmVZzrstAEkw=s151"*/}
                {/*                alt="veldora profile"/>*/}

                {/*            <div className="flex flex-col ml-4">*/}

                {/*                <span>veldora</span>*/}
                {/*                <span className="text-sm text-gray-600">english</span>*/}

                {/*            </div>*/}

                {/*        </div>*/}

                {/*        <span>$ 25</span>*/}

                {/*    </a>*/}

                {/*    <div className="mt-4 flex justify-center capitalize text-blue-600">*/}
                {/*        <a href="#">see all</a>*/}
                {/*    </div>*/}

            </aside>
        )
    }
}