import React, { Component } from 'react';
//import { withRouter } from 'next/router'
import ContentWrapper from '@/components/Layout/ContentWrapper';
import { Row, Col, Card, Button, CardHeader, CardFooter, Table, Nav, NavItem, NavLink, TabContent, TabPane, Pagination, PaginationItem, PaginationLink, ListGroup, ListGroupItem, Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
//import { Row, Col, Card, CardHeader, CardFooter, Table, Pagination, PaginationItem, PaginationLink } from 'reactstrap';
// import { Row, Col, Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
import Select from 'react-select';
import { GoogleMap, LoadScript, Marker } from '@react-google-maps/api';
import { GetServerSideProps, NextPage } from 'next';
import ErrorPage from 'next/error';
import fetch from 'node-fetch';
import https from 'https';
const containerStyle = {
    width: '100%',
    height: '155px'
};
import FormWizardVertical from './sanksi.proses.wizard.js';
var jenisPelanggaran = [];
//const qpt_id = {};
//http://localhost:3000/app/profile?ptId=0BCE4DB7-B207-445D-8D03-0C54B7688252
// Demo with custom style
const DemoMapCustomStyle = props => (
        
        
        
)
const styleHeaderText = {
    color: 'brown'
}
class Profile extends Component {
    toggleTab = tab => {
        if (this.state.activeTab !== tab) {
            this.setState({
                activeTab: tab
            });
        }
    }
    
    static async getInitialProps({ query }) {
        
        const httpsAgent = new https.Agent({
            rejectUnauthorized: false,
          });
        
          //console.log('post agent : ');
         //const res = await fetch('https://api.kemdikbud.go.id:8243/pddikti/1.2/pt/707C3895-B546-4DA5-A6A7-EFE7461A7C7E', { 
        //  const res = await fetch('https://api.kemdikbud.go.id:8243/pddikti/1.2/pt/'+query.ptId, { 
        //     method: 'get', 
        //     headers: new Headers({
        //       'Authorization': 'Bearer 5b62f743-eef2-3370-8c66-6951b2e9c2c5', 
        //       'Accept': 'application/json'
        //     }),
        //     agent: httpsAgent
        //   }
        //  )
        //console.log('res : ', res);
         
        //const json = await res.json();
        //console.log('json : ', json);
        const json = [
                        {
                            "id": "0BCE4DB7-B207-445D-8D03-0C54B7688252",
                            "kode": "031031",
                            "kode_satker": null,
                            "nama": "Universitas Satyagama",
                            "nama_singkat": "USG",
                            "sk_pendirian": "0742/O/1990",
                            "tgl_sk_pendirian": "1990-12-22",
                            "sk_operasional": null,
                            "tgl_sk_operasional": null,
                            "status": "N",
                            "alamat": {
                            "jalan": "Jalan Kamal Raya No 2-A Cengkareng",
                            "rt": null,
                            "rw": null,
                            "dusun": null,
                            "kelurahan": "-",
                            "kode_pos": "11730",
                            "kab_kota": {
                                "id": "016200",
                                "nama": "Kota Jakarta Barat"
                            }
                            },
                            "propinsi": {
                            "id": "010000",
                            "nama": "Prov. D.K.I. Jakarta"
                            },
                            "telepon": "(021) 5452377-78",
                            "faksimile": "(021) 54391325",
                            "website": "www.satyagama.ac.id",
                            "email": "info@satyagama.ac.id",
                            "status_milik": {
                            "id": "3",
                            "nama": "Yayasan"
                            },
                            "pembina": {
                            "id": "728989DD-251E-4516-BE2C-BA17A93A5C51",
                            "nama": "LLDIKTI III"
                            },
                            "bentuk_pendidikan": {
                            "id": "23",
                            "nama": "Universitas"
                            },
                            "last_update": "2021-08-22",
                            "negara": {
                            "id": "ID",
                            "nama": "Indonesia"
                            }
                    }
                ]
        return { data: json[0] }
      }
    state = {
        dropdownOpen: false,
        dropdownOpenUpload: false,
        timelineAlt: false,
        location: { lat: 33.7906731, lng: -117.8357194 },
        customStyle: [{featureType:'water',stylers:[{visibility:'on'},{color:'#bdd1f9'}]},{featureType:'all',elementType:'labels.text.fill',stylers:[{color:'#334165'}]},{featureType:'landscape',stylers:[{color:'#e9ebf1'}]},{featureType:'road.highway',elementType:'geometry',stylers:[{color:'#c5c6c6'}]},{featureType:'road.arterial',elementType:'geometry',stylers:[{color:'#fff'}]},{featureType:'road.local',elementType:'geometry',stylers:[{color:'#fff'}]},{featureType:'transit',elementType:'geometry',stylers:[{color:'#d8dbe0'}]},{featureType:'poi',elementType:'geometry',stylers:[{color:'#cfd5e0'}]},{featureType:'administrative',stylers:[{visibility:'on'},{lightness:33}]},{featureType:'poi.park',elementType:'labels',stylers:[{visibility:'on'},{lightness:20}]},{featureType:'road',stylers:[{color:'#d8dbe0',lightness:20}]}],
        listA: [],
        //isChecked:true,
        selectedOptionMulti: [],
        activeTab: 'tasks'
        
    }
    toggleDD = () => this.setState({
        dropdownOpen: !this.state.dropdownOpen
    })
    toggleDDUpload = () => this.setState({
        dropdownOpenUpload: !this.state.dropdownOpenUpload
    })
    toggleTimeline = e => {
        this.setState({
            timelineAlt: e.target.checked
        })
    }
    // // handle particular changes on each checkbox
    // onHandleChange(listName,index) {
      
    //     //set state to checkbox and data in promise mode
    //     this.setState({
    //         [listName]: this.state[listName].map(
    //                     (item, i) => (
                            
    //                             index !== i ? 
    //                             item : {...item, checked: !this.state[listName][index].checked}
    //                         ) 
    //                 )
    //     });
    // }
    // state = {
    //     location: { lat: 33.7906731, lng: -117.8357194 },
    //     customStyle: [{featureType:'water',stylers:[{visibility:'on'},{color:'#bdd1f9'}]},{featureType:'all',elementType:'labels.text.fill',stylers:[{color:'#334165'}]},{featureType:'landscape',stylers:[{color:'#e9ebf1'}]},{featureType:'road.highway',elementType:'geometry',stylers:[{color:'#c5c6c6'}]},{featureType:'road.arterial',elementType:'geometry',stylers:[{color:'#fff'}]},{featureType:'road.local',elementType:'geometry',stylers:[{color:'#fff'}]},{featureType:'transit',elementType:'geometry',stylers:[{color:'#d8dbe0'}]},{featureType:'poi',elementType:'geometry',stylers:[{color:'#cfd5e0'}]},{featureType:'administrative',stylers:[{visibility:'on'},{lightness:33}]},{featureType:'poi.park',elementType:'labels',stylers:[{visibility:'on'},{lightness:20}]},{featureType:'road',stylers:[{color:'#d8dbe0',lightness:20}]}]
    // }
    
    // renderTableData() {
    //     //const dataTable = this.props.data;
    //     //if (dataTable === true ) {
    //         return this.state.tbljenisPelanggaran.map((jp,index) => {
            
    //         return (
    //                 // 
    //                 //     | //                 //         
    //                 ////                 // | //                 // //                 ////                 //
    //                 //             //                 //  //                 // 
    //                 //              
    //                 //                  
    //                 //                      {pt.nama}
    //                 //                     {pt.sk_pendirian} - {pt.website} - {pt.email} 
    //                 //                      {pt.alamat.jalan} 
    //                 //                 
    //                 //                  
    //                 //                     
    //                 //                  
    //                 //             
    //                 //          | 
    //             
    //                 | // | // ////
    //                          
    //                              
                                    
    //                                  {jp.Pelanggaran} 
    //                                  TMT : {jp.TMTBulan} Bulan 
    //                                  Level Pelanggaran : {jp.LabelSangsi} 
                                    
    //                             
    //                         
    //                      | // ////
    //                          
    //                              
    //                                  {jp.Sangsi} 
    //                                  Keterangan : {jp.KeteranganSangsi} 
    //                             
    //                         
    //                      | // //
    //                         
    //                     // | 
    //         )
    //         })
    //     //}
    //  }
/*     handleApplyClick = () => {
        const _noSangsi = document.getElementById('noSangsi').value
        
        const _hisJP=[];
        //Get data for filter by checked
        this.state.tbljenisPelanggaran.filter(
            _jp => _jp.checked == true
        ).map(selectedPelanggaran => (
            _hisJP.push(selectedPelanggaran)
        ));
        
        this.state.hisJenisPelanggaran.push(
            {
                "noSangsi":_noSangsi,
                "pelanggaran":_hisJP
            }
        )
        console.log("Result hisJenisPelanggaran : ", this.state.hisJenisPelanggaran)
    } */
    render() {
        const { selectedOptionMulti } = this.state;
        return (
            
                
                    
                         
                        {this.props.data.nama}
                        {this.props.data.website}
                        {this.props.data.sk_pendirian}
                        {this.props.data.alamat.jalan}
                     
                 
                {/* 
                    
                        
                            400
                            
                                Profile
                                Views
                            
                        
                        
                            2000
                            Likes
                        
                        
                            100
                            Following
                        
                    
                  */}
                {/* START card */}
                
                    {/* 
                         */}
                                            {/* START panel tab */}
                {/*  */}
                    
                    
                    
                        
                            
                                {/* START card */}
                                
                                    Daftar Pelanggaran
                                    {/* START table-responsive */}
                                    
                                        
                                            
                                                | ID Laporan | UUID Pelanggaran | Progres | Aktivitas Terakhir |  | 
                                        
                                        
                                            
                                                | {/* ABCDEFGH012345*/} BI:54678 | {/* ABCDEFGH012345*/} ABCDEFGH012345 | 
                                                        
                                                            {/* 80% Complete  */}
                                                            {/*   */}
                                                         | 05/05/2021{/* 05/05/2021*/} | 
                                                        
                                                     | 
                                           
                                        
                                    
                                    {/* END table-responsive */}
                                
                                {/* END card */}
                                                            
                            
                {/* 
 */}
                
                    
                
            
            );
    }
}
export default Profile;