import type { UserImage } from "../../network";
import { SearchCardContact } from "./SearchCardContact";
import { SearchCardEvent } from "./SearchCardEvent";
import { SearchCardLocation } from "./SearchCardLocation";
import { SearchCardNote } from "./SearchCardNote";

export const SearchCard = (props: { item: UserImage }) => {
    const { item } = props;

    switch (item.type) {
        case "location":
            return <SearchCardLocation item={item} />;
        case "event":
            return <SearchCardEvent item={item} />;
        case "note":
            return <SearchCardNote item={item} />;
        case "contact":
            return <SearchCardContact item={item} />;
        default:
            return null;
    }
};
