export const categoryFormInitialValues = ( id = null, data = null ) => {
	if ( id && data && data.length > 0 ) {
		const category = data.find(
			( item ) => Number( item.id ) === Number( id )
		);
		if ( category ) {
			return {
				id: category.id,
				name: category.name,
				slug: category.slug,
				description: category.description,
			};
		}
	}
	return {
		name: '',
		slug: '',
		description: '',
	};
};

export const appName = 'quizpress';
