Skip to content
Snippets Groups Projects
Verified Commit 12efd8b6 authored by Moritz Stückler's avatar Moritz Stückler :cowboy:
Browse files

fix: remove empty category names

parent eb8c939e
No related branches found
No related tags found
1 merge request!18fix: remove empty category names
Pipeline #11421 passed
......@@ -5,10 +5,11 @@ import { Pill } from '@fchh/fcos-suite-ui';
const MapLayerControl: React.FC = () => {
const data = useStore((state) => state.poiData);
const { filterCategories, setFilterCategories } = useFilteredPoiData();
const layers = Array.from(new Set(data?.map((poi) => poi.category)));
const layers = Array.from(new Set(data?.map((poi) => poi.category.trim()).filter(Boolean)));
const onChangePills = (layer: string) => {
const isFilterActive = filterCategories.includes(layer);
if (isFilterActive) {
const updatedFilters = filterCategories.filter((filter) => filter !== layer);
setFilterCategories(updatedFilters);
......@@ -19,7 +20,7 @@ const MapLayerControl: React.FC = () => {
return (
<div className="fcmap-order-2 md:fcmap-order-1 fcmap-flex fcmap-items-start fcmap-justify-center md:fcmap-justify-end fcmap-flex-wrap fcmap-gap-[9px] fcmap-pointer-events-auto">
{layers.map((layer) => {
{layers?.map((layer) => {
return (
<Pill
key={layer}
......
import clsx from "clsx";
interface SidebarContainerProps {
className?: string;
children: React.ReactNode;
......@@ -7,9 +9,11 @@ interface SidebarContainerProps {
const SidebarContainer: React.FC<SidebarContainerProps> = ({ className, children, clickable = true }) => {
return (
<aside
className={`fcmap-w-full md:fcmap-w-[336px] fcmap-h-full fcmap-overflow-y-auto fcmap-z-10 ${
clickable ? 'fcmap-pointer-events-auto' : 'fcmap-pointer-events-none'
} ${className ?? ''}`}
className={clsx(
'fcmap-w-full md:fcmap-w-[336px] fcmap-h-full fcmap-overflow-y-auto fcmap-z-10',
clickable ? 'fcmap-pointer-events-auto' : 'fcmap-pointer-events-none',
className,
)}
>
<div
className={`fcmap-shadow-lg fcmap-w-full fcmap-max-h-full md:sidebar-height fcmap-min-h-min fcmap-bg-white fcmap-box-border fcmap-flex fcmap-flex-col`}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment