import React from "react"; import { StreamType } from "../../types/StreamType"; import { CategoryType } from "../../types/CategoryType"; import { UserType } from "../../types/UserType"; import { VodType } from "../../types/VodType"; import { DownloadIcon, UploadIcon } from "lucide-react"; // 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}

{!window.location.href.includes('/category/') ? 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 (
{ e.currentTarget.src = "/images/pfps/default.png"; e.currentTarget.onerror = null; }} alt={`user ${username}`} className="rounded-xl border-[0.15em] border-[var(--bg-color)] aspect-video cursor-pointer" style={{ backgroundColor: 'white' }} /> {isLive && (

Currently Live!

)}
); }; // VODs item component interface VodListItemProps extends BaseListItemProps, Omit { variant?: string; } const VodListItem: React.FC = ({ vod_id, title, username, category_name, views, length, datetime, thumbnail, onItemClick, extraClasses = "", variant, }) => { return (
{/* Thumbnail */} {title} {/* Duration badge */} {length &&
{length}
}

{title}

{variant != "vodDashboard" &&

{username}

}

{category_name}

{datetime &&

{datetime}

} {/*

{views} views

*/}
{variant === "vodDashboard" && ( )}
); }; export { StreamListItem, CategoryListItem, UserListItem, VodListItem };