import React, { Component } from 'react';
import { Typography, AppBar, Tabs, Tab, TextField } from '@material-ui/core';
import HomePage from './HomePage';
import Images from '../assets/Images';

export default class Profile extends Component {
    constructor(props) {
        super(props)
        this.state = {
            tab: 0
        }
    }
    selectTab = (event, newEvent) => {
        this.setState({ tab: newEvent })
    }
    render() {
        return (
            <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
                <div style={{ height: 203, backgroundColor: '#354960', flex: 1, display: 'flex', alignItems: 'flex-end', padding: 20 }}>
                    <div style={{ display: 'flex', alignItems: 'center' }}>
                        <div style={{ height: 72, width: 72, backgroundColor: 'white', borderRadius: 40, marginRight: 20 }} />
                        <Typography style={{ fontSize: '24px', color: 'white', fontWeight: 'bold' }}>John Doe</Typography>
                    </div>
                </div>
                <div>
                    <AppBar position="static">
                        <Tabs indicatorColor="primary" value={this.state.tab} onChange={this.selectTab} aria-label="simple tabs example" style={{ backgroundColor: '#f8f8f8', borderColor: 'transparent' }}>
                            <Tab label="KATA SANDI" style={{ color: '#4b4b4b', fontSize: 11 }} />
                            <Tab label="OTORISASI PERUSAHAAN" style={{ color: '#4b4b4b', fontSize: 11 }} />
                        </Tabs>
                    </AppBar>
                    {this.state.tab == 0 ?
                        <div style={{ padding: 20, marginTop: 10, marginBottom: 100 }}>
                            <div style={{ width: 432, borderRadius: 6, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)' }}>
                                <div style={{ width: '100%', height: 64, backgroundColor: '#354960', display: 'flex', paddingLeft: 20, borderTopLeftRadius: 6, borderTopRightRadius: 6, alignItems: 'center' }}>
                                    <Typography style={{ fontSize: '13px', color: 'white', fontWeight: 'bold' }}>Kata Sandi</Typography>
                                </div>
                                <div style={{ padding: 20, justifyContent: 'space-between' }}>
                                    <TextField
                                        style={{ width: '100%'}}
                                        inputProps={{ style: { fontSize: 11 } }}
                                        id="filled-required"
                                        label="Kata Sandi Saat Ini"
                                        defaultValue=""
                                        variant="outlined"
                                    />
                                    <TextField
                                        style={{ width: '100%', marginTop: 20 }}
                                        inputProps={{ style: { fontSize: 11 } }}
                                        id="filled-required"
                                        label="Kata Sandi Baru"
                                        defaultValue=""
                                        variant="outlined"
                                    />
                                    <TextField
                                        style={{ width: '100%', marginTop: 20}}
                                        inputProps={{ style: { fontSize: 11 } }}
                                        id="filled-required"
                                        label="Konfirmasi Kata Sandi Baru"
                                        defaultValue=""
                                        variant="outlined"
                                    />
                                </div>
                                <div style={{width: '100%', backgroundColor: '#f5f5f5', height: 43, display: 'flex', justifyContent: 'flex-end', padding: 10, borderColor: 'rgba(0, 0, 0, 0.25)', borderWidth: .2, borderStyle: 'dotted'}}>
                                    <div style={{backgroundColor: '#354960', textAlign: 'center', height: 25, width: 64, borderRadius: 3}}>
                                       <span style={{color: 'white', fontSize: 11}}>Simpan</span>
                                    </div>
                                </div>
                            </div>
                        </div> :
                        <div style={{ padding: 20, marginTop: 10, marginBottom: 100 }}>
                        <div style={{ width: 432, borderRadius: 6, boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.25)' }}>
                            <div style={{ width: '100%', height: 64, backgroundColor: '#354960', display: 'flex', paddingLeft: 20, borderTopLeftRadius: 6, borderTopRightRadius: 6, alignItems: 'center' }}>
                                <Typography style={{ fontSize: '13px', color: 'white', fontWeight: 'bold' }}>Otorisasi Perusahaan</Typography>
                            </div>
                            <div style={{ padding: 20 }}>
                                <div style={{ display: 'flex'}}>
                                    <img src={Images.check} style={{ marginRight: 10}}/>
                                    <Typography style={{fontSize: 14, opacity: .5, color: '#4b4b4b'}}>Agro PersadaTriputra </Typography>
                                </div>
                                <div style={{ display: 'flex', marginTop: 20}}>
                                    <img src={Images.check} style={{ marginRight: 10}}/>
                                    <Typography style={{fontSize: 14, opacity: .5, color: '#4b4b4b'}}>Dharma Group</Typography>
                                </div>
                                <div style={{ display: 'flex', marginTop: 20, paddingLeft: 20}}>
                                    <img src={Images.check} style={{ marginRight: 10}}/>
                                    <Typography style={{fontSize: 14, opacity: .5, color: '#4b4b4b'}}>Dharma Polimetal</Typography>
                                </div>
                                <div style={{ display: 'flex', marginTop: 20, paddingLeft: 20}}>
                                    <img src={Images.check} style={{ marginRight: 10}}/>
                                    <Typography style={{fontSize: 14, opacity: .5, color: '#4b4b4b'}}>Dharma Poliplast</Typography>
                                </div>
                            </div>
                        </div>
                    </div>
                    }
                </div>
            </div>
        );
    }
}
