Skip to content

Commit 5c2b26e

Browse files
committed
refactor: update ListingComponent to use dynamic placeholder and redirection URL
1 parent 6be683e commit 5c2b26e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/[locale]/(user)/components/ListingComponent.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ interface ListingProps {
195195
categoryName?: string;
196196
categoryDescription?: string;
197197
categoryImage?: string;
198+
placeholder: string;
199+
redirectionURL: string;
198200
}
199201

200202
const ListingComponent: React.FC<ListingProps> = ({
@@ -204,6 +206,8 @@ const ListingComponent: React.FC<ListingProps> = ({
204206
categoryName,
205207
categoryDescription,
206208
categoryImage,
209+
placeholder,
210+
redirectionURL,
207211
}) => {
208212
const [facets, setFacets] = useState<{
209213
results: any[];
@@ -348,7 +352,7 @@ const ListingComponent: React.FC<ListingProps> = ({
348352
label="Search"
349353
name="Search"
350354
className={cn(Styles.Search)}
351-
placeholder="Start typing to search for any Dataset"
355+
placeholder={placeholder}
352356
onSubmit={(value) => handleSearch(value)}
353357
onClear={(value) => handleSearch(value)}
354358
/>
@@ -561,7 +565,7 @@ const ListingComponent: React.FC<ListingProps> = ({
561565
view === 'expanded' ? 'expanded' : 'collapsed'
562566
}
563567
iconColor="warning"
564-
href={`/datasets/${item.id}`}
568+
href={`${redirectionURL}/${item.id}`}
565569
/>
566570
);
567571
})}

0 commit comments

Comments
 (0)