import React from "react"; import { StreamType } from "../../types/StreamType"; import { CategoryType } from "../../types/CategoryType"; import { UserType } from "../../types/UserType"; // Base props that all item types share interface BaseListItemProps { onItemClick?: () => void; extraClasses?: string; } // Stream item component interface StreamListItemProps extends BaseListItemProps, Omit {} const StreamListItem: React.FC = ({ title, username, streamCategory, viewers, thumbnail, onItemClick, extraClasses = "", }) => { return (
{thumbnail ? ( {title} ) : (
)}

{title}

{username}

{streamCategory}

{viewers} viewers

); }; // Category item component interface CategoryListItemProps extends BaseListItemProps, Omit {} const CategoryListItem: React.FC = ({ title, viewers, thumbnail, onItemClick, extraClasses = "", }) => { return (
{thumbnail ? ( {title} ) : (
)}

{title}

{viewers} viewers

); }; // User item component interface UserListItemProps extends BaseListItemProps, Omit {} const UserListItem: React.FC = ({ title, username, isLive, onItemClick, extraClasses = "", }) => { return (
{`user {isLive && (

Currently Live!

)}
); }; // Legacy wrapper component for backward compatibility export interface ListItemProps { type: "stream" | "category" | "user"; id: number; title: string; username?: string; streamCategory?: string; viewers: number; thumbnail?: string; onItemClick?: () => void; extraClasses?: string; isLive?: boolean; } export { StreamListItem, CategoryListItem, UserListItem };