import { settingsSelector } from 'utils/settings';

import { safe } from 'lib/reducer';


export { fetchList as fetchPayments, paymentSummaryReportAction, paymentTimelineReportAction, paymentStatusReportAction } from '../PaymentList/redux';
export { fetchList as fetchCategories } from '../PaymentCategory/redux';
export { paymentReportAction } from '../PaymentReport/redux';



export const selector = settingsSelector((state) => {
    if (!state || !state.get) {
        return {};
    }

    let payments = safe(state.get("paymentList"));
    let categories = safe(state.get("paymentCategoryList"));
    let report = safe(state.get("paymentReport"));
    let periodParams = safe(state.getIn(["params", "period"]));

    return { payments, categories, report, pending: false, periodParams };
});
