"use client";

import FilterCategory from "@comp/Category/FilterCategory/page";
import AppContext from "@ctx/AppContext";
import { useContext } from "react";
import { BottomSheet } from "react-spring-bottom-sheet";

const BottomSheetFilter = ({ data }) => {
  const CTX = useContext(AppContext);
  const cart = CTX.state.cart;

  return (
    <BottomSheet
      open={CTX.state.bottomSheetFilterOpen}
      onDismiss={() => CTX.setBottomSheetFilterOpen(false)}
      className={"z-50 relative"}
    >
      <div className="text-center p-3">
        <FilterCategory
          id={data.id}
          isChecked={data.isChecked}
          setIsChecked={data.setIsChecked}
          selectedBrands={data.selectedBrands}
          setSelectedBrands={data.setSelectedBrands}
          rangePrice={data.rangePrice}
          setRangePrice={data.setRangePrice}
          sortBy={data.sortBy}
          setIsRangePrice={data.setIsRangePrice}
          isRangePrice={data.isRangePrice}
          theme={2}
          specialOffer={data.specialOffer}
        />
      </div>
    </BottomSheet>
  );
};

export default BottomSheetFilter;
