import React from "react";
import SkeletonThemeWrapper from "../../customization-cornor/skeletonCustomization"; 
import * as breadcrumbConstants from './BreadCrumbs.actionConstants';
import useBreadCrumb from "./BreadCrumbs.reducer";

export default (props)=>{
    let {active,applyHook,collapse}=props
    let [activeBreadCrumb,visited,onSelect,iscollapse,onCollapse]= useBreadCrumb({active,collapse},applyHook)
    let renderProps={
        onSelect:(e)=>onSelect(e,breadcrumbConstants.ON_SELECT),
        active:activeBreadCrumb,
        visited,
        iscollapse:iscollapse,
        onCollapse:(e)=>onCollapse(e,breadcrumbConstants.ON_COLLAPSE)
    };
    let { renderComponent, ...basicProps} = props;
    return <SkeletonThemeWrapper basicProps={basicProps} renderProps={renderProps} component={renderComponent} />;

}