import { string } from 'yup' import Toc from './table-of-contents' import Button from 'react-bootstrap/Button' import Image from 'react-bootstrap/Image' import { SearchTitle } from './item' import styles from './item.module.css' import Link from 'next/link' import { timeSince } from '@/lib/time' import EmailIcon from '@/svgs/mail-open-line.svg' import Share from './share' import Badges from './badge' import { MEDIA_URL } from '@/lib/constants' import { abbrNum } from '@/lib/format' import { Badge } from 'react-bootstrap' export default function ItemJob ({ item, toc, rank, children }) { const isEmail = string().email().isValidSync(item.url) return ( <> {rank ? (
{rank}
) :
}
{item.searchTitle ? : ( <>{item.title})}
{item.company && <> {item.company} } {(item.location || item.remote) && <> \ {`${item.location || ''}${item.location && item.remote ? ' or ' : ''}${item.remote ? 'Remote' : ''}`} } \ {item.boost > 0 && {abbrNum(item.boost)} boost \ } @{item.user.name} {timeSince(new Date(item.createdAt))} {item.subName && {' '}{item.subName} } {item.status === 'STOPPED' && <>{' '}stopped} {item.mine && !item.deletedAt && ( <> \ edit )}
{toc && <> }
{children && (
{isEmail &&
{item.url}
}
{children}
)} ) }