import {createSelector} from "@reduxjs/toolkit";

export const vehiclesSelector = (store) => store.vehicles;

export const selectVehicleError = createSelector([vehiclesSelector], (vehicles) => vehicles && vehicles.error);

export const selectAllActiveVehicles = createSelector([vehiclesSelector], (vehicles) => vehicles && vehicles.vehicles && vehicles.vehicles.filter((vehicle) => vehicle.status === 'active'));
