import LandingSuccess from "../../../stubs/json/landing/success.json";
import { BenefitsSectionProps, SocialProofSectionProps } from "../../components/landing";
import { ArrElement } from "../../lib";

type SectionsItemData = ArrElement<typeof LandingSuccess['body']['sections']>;
type SectionType = SectionsItemData['type'];
type SectionData = Omit<SectionsItemData, 'type'>;

export const isBenefitsSectionData = (type: SectionType, data: SectionData): data is BenefitsSectionProps['data'] => {
  return type === 'benefits-section';
};

export const isSocialProofSectionData = (type: SectionType, data: SectionData): data is SocialProofSectionProps['data'] => {
  return type === 'social-proof-section';
};