fix: project images not loading - use getCleanImgSrc for grid cards + fix URL path extraction

This commit is contained in:
parsa aghaei committed 2026-06-29 14:00:22 +03:30
1 parent 056f838172
commit 4ed83bbecf
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -5,7 +5,8 @@ export const getCleanImgSrc = (src: string): string => {
if (!src) return '/images/placeholder.jpg';
if (src.startsWith('http://') || src.startsWith('https://')) {
const urlPath = new URL(src).pathname;
return urlPath.startsWith('/storage') ? urlPath : `/images${urlPath}`;
return urlPath;
}
return src;
if (src.startsWith('/')) return src;
return `/images/projects/${src}`;
};