Dejvino's Curriculum Vitae
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

47 lines
1.1 KiB

  1. import React from 'react';
  2. import Container from 'react-bootstrap/Container';
  3. import Col from 'react-bootstrap/Col';
  4. import Row from 'react-bootstrap/Row';
  5. import JobCard from './JobCard';
  6. import { partition } from '../utils';
  7. import { Jobs } from '@/PersonalDataTypes';
  8. export type Props = {
  9. jobs: Jobs,
  10. heading: string,
  11. entriesPerRow?: number,
  12. currentHeading?: string,
  13. }
  14. const defaultProps = {
  15. entriesPerRow: 2,
  16. currentHeading: 'Currently',
  17. }
  18. export default function JobHistory(props: Props) {
  19. const jobs = props.jobs
  20. const config = {...defaultProps, ...props}
  21. return (
  22. <Container>
  23. <h2>{config.heading}</h2>
  24. {jobs.current && (
  25. <Row>
  26. <Col>
  27. <JobCard heading={config.currentHeading} {...jobs.current} />
  28. </Col>
  29. </Row>
  30. )}
  31. {partition(jobs.previous, config.entriesPerRow).map((jobs, index) => (
  32. <Row key={index}>
  33. {(jobs.map((job, subindex) => (
  34. <Col key={index + '_' + subindex}>
  35. <JobCard {...job} />
  36. </Col>
  37. )))}
  38. </Row>
  39. ))}
  40. </Container>
  41. )
  42. }