import 'package:cs_resources/generated/assets.dart';

import '../garagesale/garagesale_page.dart';
import '../newsfeed/newsfeed_page.dart';

class CommunityVmState {
  List<Map<String, dynamic>>? topSectionsData;
  int? curIdx;

  CommunityVmState({
    List<Map<String, dynamic>>? topSectionsData,
    this.curIdx = 0,
  }) : topSectionsData = topSectionsData?? [
    {
      "title": "News Feed",
      "icon": Assets.communityNesFeed,
      "pageStartInstanceFn": NewsfeedPage.startInstance,
      "page": const NewsfeedPage(),
    },
    {
      "title": "Garage Sale",
      "icon": Assets.communityGarageSale,
      "pageStartInstanceFn": GaragesalePage.startInstance,
      "page": const GaragesalePage(),
    },
  ];

  CommunityVmState copyWith({
    List<Map<String, dynamic>>? topSectionsData,
    int? curIdx = 0,
  }) {
    return CommunityVmState(
      topSectionsData: topSectionsData ?? this.topSectionsData,
      curIdx: curIdx ?? 0,
    );
  }
}