import os

import click
import dash
import dash_html_components as html
import dash_core_components as dcc
import flask
from dash import Output , Input
import dash_bootstrap_components as dbc
import numpy as np
import pickle
from app import app



cardForm = html.Div([
    html.Form([
        dbc.Input(placeholder='enter Name', name='name'),
        html.Br(),
        dbc.Input(placeholder='enter Name', name='name'),
        html.Br(),
        dbc.Input(placeholder='enter Name', name='name'),
        html.Br(),
        dbc.Input(placeholder='enter Name', name='name'),
        html.Br(),
        html.Center(dbc.Button(html.B('Submit'), type='submit', color='primary'))
    ],action='/predict',method='post'),
    html.P(id='data_clicked')
], className='cardFrom')

cardDisplay = html.Div([

], className='cardDisplay')

content = html.Div([
    cardForm,
    cardDisplay
], className='classify-content')

layout = html.Div(
    [
        content
    ], className='layout'
)

@app.server.route('/predict',methods=['post'])
def route_fun():
    name = flask.request.form['name']
    print(name)
    return flask.redirect('/')

