import { ComponentProps, FC } from "react"; import { DataList } from "../DataList"; import { cn } from "../../../../lib/utils"; import { View } from "react-native"; export type Content = | (ComponentProps & { type: "item"; }) | (ComponentProps & { type: "person"; }) | (ComponentProps & { type: "company"; }) | (ComponentProps & { type: "team"; }) | (ComponentProps & { type: "dot-tag"; }); export interface DetailsItemType { title: string; content: Content | Content[]; spacingAtTheBottom?: boolean; isHorizontalItem?: boolean; tableView?: boolean; } const ItemContent: FC<{ content: Content }> = ({ content }) => ( <> {content.type === "person" && } {content.type === "item" && } {content.type === "team" && } {content.type === "company" && } {content.type === "dot-tag" && } ); export const DetailsItem = ({ title, content, isHorizontalItem = false, tableView = false, spacingAtTheBottom, }: DetailsItemType) => { const contentArray = Array.isArray(content) ? content : [content]; return ( {contentArray.map((c, i) => ( ))} ); };