import { countLifePostParagraphs, getLifePostImages } from "./content";
import { lifePosts } from "./posts";
import type { LifeContentBlock, LifePostImage } from "./types";

const inlineContent: LifeContentBlock[] = [
  { type: "paragraph", text: "first paragraph" },
  {
    type: "image",
    src: "/life/demo/step.jpg",
    alt: "Demo step",
    caption: "A demo image inside the article.",
    display: "original",
    align: "center",
    width: 320,
    height: 240,
  },
  { type: "paragraph", text: "second paragraph" },
];

for (const post of lifePosts) {
  const images: LifePostImage[] = getLifePostImages(post);
  const paragraphCount: number = countLifePostParagraphs(post);

  void images;
  void paragraphCount;
}

const inlineImages: LifePostImage[] = getLifePostImages({
  ...lifePosts[0],
  content: inlineContent,
});
const inlineParagraphCount: number = countLifePostParagraphs({
  ...lifePosts[0],
  content: inlineContent,
});

void inlineImages;
void inlineParagraphCount;
