ADD: Navigation to Vods in Home Page

This commit is contained in:
EvanLin3141
2025-03-06 19:34:43 +00:00
parent 4a27f69776
commit db0d78419c
2 changed files with 10 additions and 6 deletions

View File

@@ -50,6 +50,12 @@ const ListRow = forwardRef<ListRowRef, ListRowProps>((props, ref) => {
const scrollAmount = window.innerWidth * 0.4;
const navigate = useNavigate();
const handleVodClick = (item: VodType) => {
if (type === "vod" && "username" in item && "vod_id" in item) {
navigate(`/stream/${item.username}/vods/${item.vod_id}`); // ✅ Directly navigate
}
};
const addMoreItems = (newItems: ItemType[]) => {
setCurrentItems((prevItems) => [...prevItems, ...newItems]);
};
@@ -180,7 +186,7 @@ const ListRow = forwardRef<ListRowRef, ListRowProps>((props, ref) => {
length={item.length}
views={item.views}
thumbnail={item.thumbnail}
onItemClick={() => onItemClick(item.vod_id.toString())}
onItemClick={() => handleVodClick(item)}
extraClasses={itemExtraClasses}
variant={variant}
/>