izradena poslovna logika

This commit is contained in:
2026-05-25 04:25:34 +00:00
parent 668195e642
commit e0a3dea68a
127 changed files with 2417 additions and 6509 deletions

View File

@@ -0,0 +1,31 @@
// src/components/Gallery.jsx
import { h } from 'preact';
export default function Gallery({ images = [] }) {
// Uvijek vraćamo isti 'div' wrapper da spriječimo hydration mismatch
return (
<div style={{ marginTop: '1rem' }}>
{!images || images.length === 0 ? (
<p class="text-sm text-gray-500 italic">Nema fotografija za ovaj nalog.</p>
) : (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(150px, 1fr))', gap: '1rem' }}>
{images.map((item) => (
<a
href={item.slika}
target="_blank"
rel="noopener noreferrer"
key={item.id}
style={{ display: 'block', borderRadius: '8px', overflow: 'hidden', border: '1px solid #333' }}
>
<img
src={item.slika}
alt={item.opis || 'Foto dokumentacija'}
style={{ width: '100%', height: '150px', objectFit: 'cover' }}
/>
</a>
))}
</div>
)}
</div>
);
}