UPDATE: Extract category thumbnail handling to separate function

This commit is contained in:
Chris-1010
2025-02-27 14:01:37 +00:00
parent cba900f8e0
commit ff422f06f7
8 changed files with 58 additions and 45 deletions

View File

@@ -10,6 +10,7 @@ import DynamicPageContent from "../components/Layout/DynamicPageContent";
import LoadingScreen from "../components/Layout/LoadingScreen";
import { StreamListItem } from "../components/Layout/ListItem";
import { CameraIcon } from "lucide-react";
import { getCategoryThumbnail } from "../utils/thumbnailUtils";
interface UserProfileData {
id: number;
@@ -78,11 +79,10 @@ const UserPage: React.FC = () => {
currentStreamCategory: streamData.category_id,
currentStreamViewers: streamData.num_viewers,
currentStreamStartTime: streamData.start_time,
currentStreamThumbnail:
streamData.thumbnail ||
`/images/category_thumbnails/${streamData.category_name
.toLowerCase()
.replace(/ /g, "_")}.webp`,
currentStreamThumbnail: getCategoryThumbnail(
streamData.category_name,
streamData.thumbnail
),
};
});
let variant: "user" | "streamer" | "personal" | "admin";