Merged in feat/SW-1443-card-gallery-destination-overview (pull request #1362)
feat(SW-1443): added cardGallery block to destination overview page instead of carousel functionality * feat(SW-1443): added cardGallery block to destination overview page instead of carousel functionality Approved-by: Fredrik Thorsson
This commit is contained in:
42
components/TabFilters/index.tsx
Normal file
42
components/TabFilters/index.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
"use client"
|
||||
|
||||
import styles from "./tabFilters.module.css"
|
||||
|
||||
import type { CardGalleryFilter } from "@/types/enums/cardGallery"
|
||||
import type { CarouselCardFilter } from "@/types/enums/carouselCards"
|
||||
|
||||
interface Filter {
|
||||
identifier: CarouselCardFilter | CardGalleryFilter
|
||||
label: string
|
||||
}
|
||||
|
||||
interface TabFiltersProps {
|
||||
categories: Array<Filter>
|
||||
selectedFilter: Filter["identifier"]
|
||||
onFilterSelect: (filter: Filter["identifier"]) => void
|
||||
}
|
||||
|
||||
export default function TabFilters({
|
||||
categories,
|
||||
selectedFilter,
|
||||
onFilterSelect,
|
||||
}: TabFiltersProps) {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
{categories.map((category) => (
|
||||
<button
|
||||
key={category.identifier}
|
||||
onClick={() => onFilterSelect(category.identifier)}
|
||||
className={
|
||||
selectedFilter === category.identifier
|
||||
? styles.filterSelected
|
||||
: styles.filter
|
||||
}
|
||||
type="button"
|
||||
>
|
||||
{category.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user