From 06e39b58c6f787344820265556347e0a1e56c00e Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Mon, 18 May 2026 20:46:02 +0300 Subject: [PATCH] =?UTF-8?q?refactor:=20ProjectsSection=20=E2=80=94=20use?= =?UTF-8?q?=20shared=20buildFileUrl,=20pass=20url=20prop,=20switch=20to=20?= =?UTF-8?q?stacked=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/ProjectsSection/ProjectsSection.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) 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) => ( ))}