feat: require admin approval for new photos, show placeholder otherwise

This commit is contained in:
Jannik committed 2026-09-24 04:24:36 +02:00
1 parent 611cd82763
commit b1093b37cd
1 file changed
+18 -12
+18 -12
View File
@@ -207,22 +207,28 @@ export default function AdminDashboard() {
borderRadius: 'var(--radius)',
overflow: 'hidden',
border: '1px solid var(--color-border)',
opacity: item.published ? 1 : 0.6,
opacity: (!item.wasOncePublished && !item.published) ? 1 : (item.published ? 1 : 0.6),
transition: 'opacity 0.2s'
}}
>
<div style={{ position: 'relative', aspectRatio: '1/1', background: '#eee' }}>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={`/api/media/${item.relativePath}?type=thumb`}
alt={item.filename}
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
loading="lazy"
/>
{item.mediaType === 'VIDEO' && (
<div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(0,0,0,0.3)' }}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="none"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
</div>
{(!item.wasOncePublished && !item.published) ? (
<div style={{ width: '100%', height: '100%', background: '#fff' }} />
) : (
<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={`/api/media/${item.relativePath}?type=thumb`}
alt={item.filename}
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
loading="lazy"
/>
{item.mediaType === 'VIDEO' && (
<div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(0,0,0,0.3)' }}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="none"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
</div>
)}
</>
)}
</div>