Files
o2o-site-AEO/solution/frontend/src/features/builder/canvas/variants/photos/PhotosCarousel.tsx
T
minaChoiandClaude Opus 5 c85c577349 이름: solution/front → solution/frontend
`backend` 옆에 `front` 가 있을 이유가 없었다. negosium 의 negodata/front 를 그대로
베꼈고 그게 왜 front 인지는 따져보지 않았다 — 근거 없이 들여온 이름이라 바로잡는다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
2026-08-31 15:27:16 +09:00

53 lines
1.7 KiB
TypeScript

/**
* 사진 · 가로 슬라이드 — 큰 사진을 한 장씩 넘겨 본다.
* 장수가 적고 한 장 한 장이 좋을 때 가장 세게 보인다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosCarousel(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="scrollbar-none flex snap-x snap-mandatory gap-3 overflow-x-auto px-1 pb-3">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="landscape"
onOpen={() => setOpenIndex(idx)}
className="w-[78vw] max-w-[420px] shrink-0 snap-center"
/>
))}
</div>
<div className="flex items-center justify-center gap-1.5">
{items.map((photo) => (
<span
key={photo.id}
className="size-1.5 rounded-full"
style={{backgroundColor: `${template.colors.primary}40`}}
/>
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}