22
33import { useRouter } from 'next/navigation' ;
44
5+ import { getCompanyLogo } from '@/helpers/companies' ;
56import { CompanyWithReports } from '@/types' ;
67import {
78 Avatar ,
@@ -28,13 +29,13 @@ export default function SitesList({
2829 companies : CompanyWithReports [ ] ;
2930} ) {
3031 const router = useRouter ( ) ;
31- return ( companies || [ ] ) . map ( ( c ) => {
32- const link = getHost ( c . domain ?? undefined ) ;
32+ return ( companies || [ ] ) . map ( ( company ) => {
33+ const link = getHost ( company . domain ?? undefined ) ;
3334
3435 return (
3536 < Card
3637 className = "w-4/5 sm:w-2/3 md:w-1/2 lg:w-10/12"
37- key = { c . id }
38+ key = { company . id }
3839 isPressable
3940 onPress = { ( ) => {
4041 router . push ( `/sites/${ link } ` ) ;
@@ -43,27 +44,29 @@ export default function SitesList({
4344 < CardHeader className = "flex justify-between items-center bg-blue-400" >
4445 < div className = "flex gap-3 items-center" >
4546 < Avatar
46- alt = { c . name + ' logo' }
47+ alt = { company . name + ' logo' }
4748 radius = "sm"
48- src = { ` ${ c . logo } ` }
49- name = { c . name }
49+ src = { getCompanyLogo ( company ) }
50+ name = { company . name }
5051 />
5152 < div className = "flex flex-col" >
52- < p className = "text-md" > { c . name } </ p >
53- < p className = "text-small text-foreground" > { c . domain } </ p >
53+ < p className = "text-md" > { company . name } </ p >
54+ < p className = "text-small text-foreground" > { company . domain } </ p >
5455 </ div >
5556 </ div >
56- < p className = "text-md" > { c . reports . length } reports</ p >
57+ < p className = "text-md" > { company . reports . length } reports</ p >
5758 </ CardHeader >
5859 < CardBody >
5960 < p >
6061 Categories:{ ' ' }
61- { c . reports . map ( ( r ) => r . tags . map ( ( tag ) => tag . name ) . join ( ', ' ) ) }
62+ { company . reports . map ( ( r ) =>
63+ r . tags . map ( ( tag ) => tag . name ) . join ( ', ' ) ,
64+ ) }
6265 </ p >
6366 </ CardBody >
6467 < CardFooter className = "flex justify-end" >
65- < Link showAnchorIcon href = { `${ c . domain } ` } >
66- { c . domain }
68+ < Link showAnchorIcon href = { `${ company . domain } ` } >
69+ { company . domain }
6770 </ Link >
6871 </ CardFooter >
6972 </ Card >
0 commit comments