@@ -7,13 +7,12 @@ import { useQuery } from '@tanstack/react-query';
77import { Divider , SearchInput , Select , Text } from 'opub-ui' ;
88
99import { GraphQL } from '@/lib/api' ;
10+ import { cn } from '@/lib/utils' ;
1011import BreadCrumbs from '@/components/BreadCrumbs' ;
1112import { ErrorPage } from '@/components/error' ;
1213import { Loading } from '@/components/loading' ;
13- import { cn } from '@/lib/utils' ;
1414import Styles from '../datasets/dataset.module.scss' ;
1515
16-
1716const sectorsListQueryDoc : any = graphql ( `
1817 query SectorsList {
1918 sectors {
@@ -42,6 +41,13 @@ const SectorsListingPage = () => {
4241 )
4342 ) ;
4443
44+ function capitalizeWords ( name : any ) {
45+ return name
46+ . split ( '-' ) // Split by '-'
47+ . map ( ( word : any ) => word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) ) // Capitalize each word
48+ . join ( '+' ) ; // Join with '+'
49+ }
50+
4551 return (
4652 < main className = "bg-baseGraySlateSolid2" >
4753 < BreadCrumbs
@@ -108,7 +114,7 @@ const SectorsListingPage = () => {
108114 < div className = "flex flex-wrap gap-6 lg:flex-nowrap" >
109115 < SearchInput
110116 label = { '' }
111- className = { cn ( 'w-full' , Styles . Search ) }
117+ className = { cn ( 'w-full' , Styles . Search ) }
112118 name = { 'Start typing to search for any sector' }
113119 />
114120 < div className = "flex items-center gap-2" >
@@ -139,22 +145,22 @@ const SectorsListingPage = () => {
139145 </ div >
140146 < div className = "grid w-full grid-cols-1 gap-10 md:grid-cols-2 lg:grid-cols-3" >
141147 { getSectorsList . data ?. sectors . map ( ( sectors : any ) => (
142- < Link href = { `/sectors/${ sectors . slug } ` } key = { sectors . id } >
148+ < Link
149+ href = { `/sectors/${ sectors . slug } ?sectors=${ capitalizeWords ( sectors . slug ) } ` }
150+ key = { sectors . id }
151+ >
143152 < div className = "flex w-full items-center gap-5 rounded-4 bg-surfaceDefault p-7 shadow-card" >
144153 < div className = "flex gap-4" >
145154 < Image
146- src = { '/obi.jpg' }
155+ src = { `/Sectors/ ${ sectors . name } .svg` }
147156 width = { 80 }
148157 height = { 80 }
149158 alt = { 'Sectors Logo' }
150159 />
151160 </ div >
152161 < div className = "flex w-full flex-col gap-3" >
153- < div className = 'flex flex-col gap-2' >
154- < Text
155- variant = "headingLg"
156- fontWeight = "semibold"
157- >
162+ < div className = "flex flex-col gap-2" >
163+ < Text variant = "headingLg" fontWeight = "semibold" >
158164 { sectors . name }
159165 </ Text >
160166 < Divider />
0 commit comments