Fakultas Ilmu Komputer UI

SupervisorPage.jsx 1.68 KB
Newer Older
sirinbaisa's avatar
sirinbaisa committed
1
2
3
import React from 'react';
import { Header, Icon } from 'semantic-ui-react';
import Tables from './Tables';
sirinbaisa's avatar
sirinbaisa committed
4
import Server from '../lib/Server';
sirinbaisa's avatar
sirinbaisa committed
5
6
7
8
9
10
11
12

const cols = [
    { key: 'StudentName', label: 'Students Name' },
    { key: 'Perusahaan', label: 'Perusahaan' },
    { key: 'Posisi', label: 'Posisi' },
    { key: 'Status', label: 'Status' },
];

sirinbaisa's avatar
sirinbaisa committed
13
const data2 = [
sirinbaisa's avatar
sirinbaisa committed
14
15
16
17
18
19
20
21
22
    { id: 1, StudentName: 'John Doe', Perusahaan: 'Jalanloka', Posisi: 'Software Engineer', Status: 'Melamar' },
    { id: 2, StudentName: 'Clark Kent', Perusahaan: 'Tutuplapak', Posisi: 'Data Scientist', Status: 'Diterima' },
    { id: 3, StudentName: 'Rosamund Pike', Perusahaan: 'Tutuplapak', Posisi: 'System Analyst', Status: 'Diterima' },
    { id: 4, StudentName: 'Melissa Benoist', Perusahaan: 'Blabla', Posisi: 'Data Scientist', Status: 'Melamar' },
];


export default class Applicants extends React.Component {

sirinbaisa's avatar
sirinbaisa committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  constructor(props) {
    super(props);

    this.state = { list: [] };
  }

  componentDidMount() {
    this.UserList();
  }

  UserList() {
    Server.get('/student-applications/', false).then((data) => {
      this.setState({ list: data.results });
    });
  }
sirinbaisa's avatar
sirinbaisa committed
38
39

  render() {
sirinbaisa's avatar
sirinbaisa committed
40
41
42
43
    const list = this.state.list.map((item, i) => <div>
      <h1>{item.name}</h1>
      <span>{item.npm}, {item.email}</span>
    </div>);
sirinbaisa's avatar
sirinbaisa committed
44
    return (
sirinbaisa's avatar
sirinbaisa committed
45

sirinbaisa's avatar
sirinbaisa committed
46
47
48
49
50
51
52
53
      <div className="home-dosen">
        <Header as="h2">
          <Icon name="list" />
          <Header.Content>
              Daftar Mahasiswa
            </Header.Content>
        </Header>

sirinbaisa's avatar
sirinbaisa committed
54

sirinbaisa's avatar
sirinbaisa committed
55
        <div id="layout-content" className="layout-content-wrapper">
sirinbaisa's avatar
sirinbaisa committed
56
          <Tables cols={cols} data={data2} />
sirinbaisa's avatar
sirinbaisa committed
57
58
          <div className="panel-list">{ list }</div>
        </div>
sirinbaisa's avatar
sirinbaisa committed
59
60
61
62
63
      </div>

    );
  }
}