Files
sanaz-goodarzi/lib/portfolio.js
T
2026-09-15 20:37:49 +03:30

21 lines
1006 B
JavaScript

import { services } from './content';
import { getPortfolios, imageUrlOf, titleOf } from './meshkee-api';
// Adapter boundary: replace these explicit placeholders with the supplied API contract.
// Images are category thumbnails from the original site, not verified individual projects.
export const portfolioItems = services.map((service, index) => ({
id: `preview-${index + 1}`, slug: service.id, category: service.id,
title: service.title, image: service.image, isPlaceholder: true,
description: 'اطلاعات و تصاویر اختصاصی پروژه‌های این بخش به‌زودی تکمیل می‌شود.'
}));
export async function getPortfolioItems() {
const remote = await getPortfolios();
if (!remote.length) return portfolioItems;
return remote.map((item) => ({
...item,
title: titleOf(item, 'نمونه‌کار معماری'),
image: imageUrlOf(item) || '/img/subheader/bg.jpg',
category: item.categoryId || item.categoryName || 'all',
isPlaceholder: false,
}));
}