import { ConfigurationProps , Page , GroupProps , CardProps , } from "../Components/Configuration/Config" ; export function findPageIdByKey ( config , key ) { return config . pages . findIndex ( ( i ) => i . key === key ) ; } export function findPageIdByPage ( config , page ) { return config . pages . findIndex ( ( i ) => i . key === page . key ) ; } export function findPageByKey ( config , key ) { return config . pages . find ( ( i ) => i . key === key ) ; } export function findGroupIdByKey ( config , key ) { return config . groups . findIndex ( ( i ) => i . key === key ) ; } export function findGroupIdByGroup ( config , group ) { return config . groups . findIndex ( ( i ) => i . key === group . key ) ; } export function findGroupByKey ( config , key ) { return config . groups . find ( ( i ) => i . key === key ) ; } export function findCardIdByKey ( config , key ) { return config . cards . findIndex ( ( i ) => i . key === key ) ; } export function findCardIdByCard ( config , card ) { return config . cards . findIndex ( ( i ) => i . key === card . key ) ; } export function findCardByKey ( config , key ) { return config . cards . find ( ( i ) => i . key === key ) ; }