const validateSchema = schema => {
  const dynamicZoneAttributes = Object.values(schema.attributes).filter(
    ({ type }) => type === 'dynamiczone'
  );

  return dynamicZoneAttributes.every(
    ({ components }) => Array.isArray(components) && components.length > 0
  );
};

export default validateSchema;
