фикс билда

This commit is contained in:
ifraimka1 committed 2025-05-15 18:33:37 +03:00
1 parent 759d9edb31
commit 2a5c730abf
3 files changed
+12 -5

No files matched your search

+10 -3
View File
@@ -6,8 +6,8 @@ export interface MediaItem {
src: string;
category: string;
name: string;
team_name: string;
team_job: string;
team_name?: string;
team_job?: string;
}
function decodeHtml(html: string) {
@@ -34,7 +34,14 @@ export const fetchMedia = async (): Promise<MediaItem[]> => {
const transformedMedia = media.map(({ id, source_url, alt_text, caption, title }) => {
const [category = "uncategorized", name = "unknown"] =
alt_text?.split("_") || [];
return { id, src: source_url, category, name, team_name: title.rendered, team_job: decodeHtml(caption.rendered)};
const newItem: MediaItem = { id, src: source_url, category, name };
if (category === "team") {
newItem.team_name = title.rendered;
newItem.team_job = decodeHtml(caption.rendered);
}
return newItem;
});
allMedia = [...allMedia, ...transformedMedia];
+1 -1
View File
@@ -16,7 +16,7 @@ interface SliderProps {
autoPlay?: boolean;
autoPlayTime?: number;
images?: string[];
category: string;
category?: string;
customPerSlide?: number;
}