import { TouchableOpacity } from "react-native";
import { IconButton, Text } from "react-native-paper";

interface CombinedFilterResetButtonProps {
  showResetButton: boolean;
  totalSelected: number;
  clearAll: () => void;
}

export const CombinedFilterResetButton = ({
  showResetButton,
  totalSelected,
  clearAll,
}: CombinedFilterResetButtonProps) =>
  showResetButton &&
  totalSelected > 1 && (
    <TouchableOpacity
      onPress={clearAll}
      className="flex-row items-center px-2 h-8 rounded bg-white ml-2"
      activeOpacity={0.7}
    >
      <Text style={{ fontSize: 12, color: "black" }}>Reset all</Text>
      <IconButton icon="close-circle-outline" size={18} onPress={clearAll} />
    </TouchableOpacity>
  );
