import * as Yup from 'yup'
import Toc from './table-of-contents'
import { Badge, Button, Image } from 'react-bootstrap'
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'
export default function ItemJob ({ item, toc, rank, children }) {
const isEmail = Yup.string().email().isValidSync(item.url)
return (
<>
{rank
? (
{rank}
)
: }
{item.company &&
<>
{item.company}
>}
{(item.location || item.remote) &&
<>
\
{`${item.location || ''}${item.location && item.remote ? ' or ' : ''}${item.remote ? 'Remote' : ''}`}
>}
\
@{item.user.name}
{timeSince(new Date(item.createdAt))}
{item.mine &&
(
<>
\
edit
{item.status !== 'ACTIVE' &&
{item.status}}
>)}
{item.maxBid > 0 && item.status === 'ACTIVE' &&
PROMOTED}
{toc &&
}
{children && (
{isEmail &&
{item.url}
}
{children}
)}
>
)
}