import { Internship, internshipTypeLabels } from "@/data"; import React from "react"; import { Paper, PaperProps, Typography, TypographyProps } from "@material-ui/core"; import { useTranslation } from "react-i18next"; import { createStyles, makeStyles } from "@material-ui/core/styles"; import classNames from "classnames"; import { useVerticalSpacing } from "@/styles"; import moment from "moment"; export type ProposalPreviewProps = { proposal: Internship; } const Label = ({ children }: TypographyProps) => { return { children } } const useSectionStyles = makeStyles(theme => createStyles({ root: { padding: theme.spacing(2), } })) const Section = ({ children, ...props }: PaperProps) => { const classes = useSectionStyles(); return { children } } export const ProposalPreview = ({ proposal }: ProposalPreviewProps) => { const { t } = useTranslation(); const classes = useVerticalSpacing(3); const duration = moment.duration(proposal.endDate.diff(proposal.startDate)); return
{ proposal.intern.name } { proposal.intern.surname } { t('internship.intern.semester', { semester: proposal.intern.semester }) } { ", " } { t('internship.intern.album', { album: proposal.intern.albumNumber }) }
{ proposal.company.name } NIP: { proposal.company.nip } { t('internship.address.city', proposal.office.address) } { t('internship.address.street', proposal.office.address) }
{ internshipTypeLabels[proposal.type].label }
{ t('internship.date-range', { start: proposal.startDate, end: proposal.endDate }) } { t('internship.duration', { duration, count: Math.floor(duration.asWeeks()) }) } { ", " } { t('internship.hours', { hours: proposal.hours }) }
{ proposal.mentor.name } { proposal.mentor.surname } { proposal.mentor.email }, { proposal.mentor.phone }
}