import Container from "@/components/Container/Container";
import Section from "@/components/Section/Section";
import TitleCta from "@/components/TitleCta/TitleCta";

const TitleCtaBlock = (props: { [rest: string]: unknown }) => {
  const titleSize =
    props.title_size === "sm" || props.titleSize === "sm" ? "sm" : "default";

  return (
    <Container id={props.anchor as string | undefined}>
      <Section gridArea="full">
        <TitleCta
          title={(props.title_label ?? props.titleLabel ?? props.title) as
            | string
            | undefined}
          ctaLabel={(props.cta_label ?? props.ctaLabel) as string | undefined}
          color="primary"
          titleSize={titleSize}
        />
      </Section>
    </Container>
  );
};

export default TitleCtaBlock;
