import React from "react";
import { InformationCard } from "@arc-ui/components/InformationCard";
import { MediaCard } from "@arc-ui/components/MediaCard";
import { type BentoInformationCard, type BentoMediaCard } from "../types/types";

/**
 * Renders either an InformationCard or a contained MediaCard based on the card type.
 */
export const renderCard = (card: BentoInformationCard | BentoMediaCard) => {
  if (card.type === "information") {
    return <InformationCard {...card} />;
  }
  if (card.type === "media") {
    return <MediaCard {...card} isContained />;
  }
  return null;
};
