import React from 'react'
import { useSelector } from 'react-redux';
import SelectCategoriesItem from './SelectCategoriesItem';

const SelectCategories = () => {
  const categorySettings = useSelector(state => {
    return state.categorySettings.list;
  });
  return (
    <div className="dreamfox-select-categories">
      <div className="dreamfox-select-categories__header">
        <div>Category</div>
        <div>Days</div>
      </div>
      {categorySettings && categorySettings.map(item => {
          return (<SelectCategoriesItem key={item.id} item={item}></SelectCategoriesItem>)
        })
      }
    </div>
  )
}

export default SelectCategories
