import * as React from 'react'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; import Divider from '@mui/material/Divider'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import { dayjs } from '@/lib/dayjs'; import type { Job } from './types'; export interface JobsCardProps { jobs?: Job[]; } export function JobsCard({ jobs = [] }: JobsCardProps): React.JSX.Element { return ( }> {jobs.map((job) => { const location = job.isRemote ? 'Remote possible' : `(${job.country}, ${job.state}, ${job.city})`; const salary = `${job.currency} ${new Intl.NumberFormat('en-US', { style: 'currency', currency: job.currency, notation: 'compact', }).format(job.budgetMin)} - ${job.currency} ${new Intl.NumberFormat('en-US', { style: 'currency', currency: job.currency, notation: 'compact', }).format(job.budgetMax)}`; return (
{job.title} {location} • {salary}
{dayjs(job.publishedAt).fromNow()}
); })}
); }