diff --git a/src/widgets/ProjectsSection/ui/ProjectsSection/ProjectsSection.tsx b/src/widgets/ProjectsSection/ui/ProjectsSection/ProjectsSection.tsx index 53209ce..d5baa3a 100644 --- a/src/widgets/ProjectsSection/ui/ProjectsSection/ProjectsSection.tsx +++ b/src/widgets/ProjectsSection/ui/ProjectsSection/ProjectsSection.tsx @@ -1,19 +1,7 @@ import { ProjectCard } from '$entities/project'; import type { ProjectRecord } from '$shared/api'; import { getCollection } from '$shared/api'; - -/** Base URL for PocketBase file storage */ -const PB_URL = process.env.NEXT_PUBLIC_PB_URL || 'http://127.0.0.1:8090'; - -/** - * Builds a PocketBase file URL for a project image. - */ -function buildImageUrl(project: ProjectRecord): string | undefined { - if (!project.image) { - return undefined; - } - return `${PB_URL}/api/files/${project.collectionId}/${project.id}/${project.image}`; -} +import { buildFileUrl } from '$shared/lib'; /** * Projects section component. @@ -25,7 +13,7 @@ export default async function ProjectsSection() { }); return ( -
+
{items.map((project) => ( ))}