import Filters from "@/src/components/custom-components/filters";
import { routes } from "@/src/config/routes";
import { useAppSelector } from "@/src/redux/hooks";


interface TrainingHeaderProps {
    onFilterChange?: (value: any) => void;
    categories?: any;
    totalCount: any
}

export default function TrainingHeader({
    onFilterChange,
    categories,
    totalCount
}: TrainingHeaderProps) {

    const {
        currentPage,
        productsPerPage
    } = useAppSelector(
        (state) => state.products
    );

    const start =
        totalCount > 0
            ? (currentPage - 1) * productsPerPage + 1
            : 0;

    const end = Math.min(
        currentPage * productsPerPage,
        totalCount
    );
    const resultText = start
        ? `Showing ${start}–${end} of ${totalCount} results`
        : "";


    return (
        <>
            <Filters
                resultText={resultText}
                title="Trainings"
                breadcrumbs={[
                    {
                        title: "Home",
                        href: routes.home
                    },
                    {
                        title: "Trainings",
                        href: routes.trainings
                    },

                ]}
            />
        </>
    )
}