import { IJobCardItem } from "src/shared/constants/card" ; import { ICompanyDetails } from "../components/CompanyDetailsCard" ; import { GetCompanyDetails_company , GetCompanyDetails_company_jobs_items , } from "./types/GetCompanyDetails" ; export const buildCompanyDetails = ( company ) : ICompanyDetails | undefined => company ? { name : company . name , desc : company . description , numRatings : company . reviews . count , avgRating : company . scoreAverages . overall , websiteUrl : company . websiteUrl , logoSrc : company . logo ?? "" , color : "" , } : undefined ; export const buildCompanyJobCard = ( item ) : IJobCardItem => ( { id : item . id , companyName : "" , name : item . name , location : item . location ?? "" , minHourlySalary : item . salaryMin . amount , maxHourlySalary : item . salaryMax . amount , hourlySalaryCurrency : item . salaryMin . currency , numRatings : item . reviews . count , avgRating : item . scoreAverages . overall , color : "" , } ) ; export const buildCompanyJobCardsList = ( data ? ) : IJobCardItem [ ] => data ?. map ( buildCompanyJobCard ) ?? [ ] ;