import { createDraftSafeSelector } from "@reduxjs/toolkit" ; import { siteSlice } from "slices/site" ; import { AppState } from "../store" ; export const getSiteData = ( ) => { return createDraftSafeSelector ( ( state ) => state , ( state ) => state ?. [ siteSlice . name ] . site ) ; } ; export const getCurrentPageData = ( ) => { return createDraftSafeSelector ( ( state ) => state , ( state ) => state ?. [ siteSlice . name ] . currentPage ) ; } ; export const getTemplateData = ( pageId ) => { return createDraftSafeSelector ( ( state ) => state , ( state ) => state ?. [ siteSlice . name ] . site . pages [ pageId ] ?. template ) ; } ; export const getSectionData = ( pageId , sectionId ) => { return createDraftSafeSelector ( ( state ) => state , ( state ) => state ?. [ siteSlice . name ] . site . pages [ pageId ] . template . sections [ sectionId ] ) ; } ; export const getPreviewDeviceTypeData = ( ) => { return createDraftSafeSelector ( ( state ) => state , ( state ) => state ?. [ siteSlice . name ] . previewDeviceType ) ; } ;