Fakultas Ilmu Komputer UI

CompanyVacancy.jsx 1.41 KB
Newer Older
1
import React from 'react';
2
import moment from 'moment';
3
import { Button, Icon, Item, Segment } from 'semantic-ui-react';
4
import { Link } from 'react-router';
5

6
7
const defaultImage = 'http://semantic-ui.com/images/wireframe/image.png';

8
export default class ApplicantList extends React.Component {
9
  static propTypes = {
10
    data: React.PropTypes.object.isRequired,
11
12
  };

13
14
15
16
17
18
19
  constructor(props) {
    super(props);
    moment.locale('id');
  }

  getLink = `/buat-lowongan/${this.props.data.id}`;

20
21
  render() {
    return (
22

23
24
      <Item className="applicantItems">
        <Item.Image src={this.props.data.company.logo ? this.props.data.company.logo : defaultImage} size="small" />
25

26
27
        <Item.Content>
          <Item.Header as="a">{this.props.data.name}</Item.Header>
28
          <Segment compact basic floated="right">
29
30
31
            {this.props.data.verified ?
              (<h4> <Icon name="checkmark box" size="large" color="green" /> Terverifikasi </h4>) :
              (<h4> <Icon name="remove circle" size="large" color="red" /> Belum Terverifikasi </h4>)}
32
33
34
35
36
            <Button color="blue" floated="right" as={Link} to={this.getLink}>
              Ubah <Icon name="right chevron" />
            </Button>
          </Segment>

37

38
39
          <Item.Extra>
            <h3> 105 Pendaftar </h3>
40
              Ditutup {moment(moment(this.props.data.close_time)).fromNow()}
41
          </Item.Extra>
42

43
        </Item.Content>
44

45
      </Item>
46

47
48
    );
  }
49
}