import { View } from "react-native";
import { Chip } from "react-native-paper";

export type SelectedChip = {
  key: string;
  label: string;
  onRemove: () => void;
};

interface SelectedFilterChipsProps {
  chips: SelectedChip[];
}

export const SelectedFilterChips = ({ chips }: SelectedFilterChipsProps) => {
  if (chips.length === 0) return null;

  return (
    <View className="flex-row flex-wrap items-center" style={{ width: '100%' }}>
      {chips.map((chip) => (
        <View key={chip.key} className="mr-1 mb-1">
          <Chip onClose={chip.onRemove}>{chip.label}</Chip>
        </View>
      ))}
    </View>
  );
};
