이름: 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
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-08-31 15:27:16 +09:00
1 parent 06f6438d9b
commit c85c577349
480 files changed
+22 -22

No files matched your search

@@ -0,0 +1,36 @@
/**
* 예약 · 띠배너 — 브랜드 색으로 화면을 가로지르는 강한 전환 유도.
* 예약이 유일한 목표인 사이트에 맞는다(대신 자주 쓰면 광고처럼 보인다).
*/
import {Calendar} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
export function BookingBanner(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="px-4 py-10 sm:px-6 sm:py-14" style={{backgroundColor: template.colors.primary}}>
<div className="mx-auto flex max-w-[880px] flex-col items-center justify-between gap-5 text-center sm:flex-row sm:text-left">
<div className="space-y-1.5 text-white">
<h3 className="serif-title text-lg font-bold sm:text-2xl">
{section.name}
</h3>
<p className="text-xs opacity-90 sm:text-sm">
{section.body || section.description || `${storeName} · 실시간 캘린더에서 남은 날짜를 확인할 수 있습니다`}
</p>
</div>
<div className="flex shrink-0 items-center gap-2">
<CtaLink href={bookingHref(industryId, storeName)} variant="pill">
<Calendar className="size-3.5" />
<span>예약 캘린더</span>
</CtaLink>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,36 @@
/**
* 예약 · 카드 — 가운데 놓인 조용한 안내 카드. 다른 섹션의 흐름을 끊지 않는다.
*/
import {Calendar} from 'lucide-react';
import {CtaLink, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
export function BookingCard(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="mx-auto max-w-lg space-y-3 rounded-xl border border-stone-200/80 bg-white p-6 text-center shadow-2xs">
<h4 className="text-sm font-bold text-stone-900" style={{color: template.colors.text}}>
네이버 실시간 온라인 예약
</h4>
<p className="text-xs text-stone-500">
{section.body || '원하시는 날짜와 객실을 선택하여 캘린더에서 바로 확정 예약하실 수 있습니다.'}
</p>
<CtaLink
href={bookingHref(industryId, storeName)}
variant="solid"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>네이버 예약 캘린더 열기</span>
</CtaLink>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,101 @@
/**
* 배리에이션들이 공유하는 데이터 갈무리.
*
* "어떤 사진을 대표로 쓰나 / 예약 링크는 어디로 가나" 같은 판단은 레이아웃과 무관하다.
* 배리에이션마다 따로 정하면 같은 섹션인데 배리에이션을 바꾼 순간 링크가 달라진다.
*
* ★ 시연용 폴백은 없다.
* 한때 이 파일은 달빛스테이(숙박 시연 세트)와 업종 시드 문구를 폴백으로 들고 있었고,
* `demoOnly()` 게이트가 "실사업장에서만" 그걸 껐다. 그 구조 자체를 걷어냈다 —
* 게이트가 한 곳이라도 빠지면 남의 가게 사진·전화번호·메뉴가 사장님 화면에 뜨고,
* 사장님은 그게 자기 가게 내용인 줄 알고 그대로 발행한다.
* 값이 없으면 **아무것도 그리지 않는다.** 발행 사이트(solution/site)와 같은 규칙이다.
*/
import type {IndustryType, InfoField, PhotoItem} from '@o2o/shared';
import {INDUSTRY_CONFIGS} from '@/data/industryData';
import type {TilePhoto} from '../primitives';
/** 화면에 찍히는 "언제 기준" 표기. 발행 사이트에서는 payload 의 updatedAt 이 이 자리를 대신한다. */
export const TODAY_KO = new Date().toLocaleDateString('ko-KR', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
/**
* 업종 설정(섹션 목록 · 템플릿 · 채널).
*
* ★ 여기에는 **구조만** 남아 있다. 문구·메뉴·FAQ 같은 콘텐츠 시드는 전부 지웠다 —
* 가공의 가게 이름이 박힌 문장("포레스트 힐은 산자락 아래…")이 실사업장 화면에
* 자기 소개문처럼 떴기 때문이다. 콘텐츠는 서버(fact·unit·faq)만 소유한다.
*/
export function industryConfig(industryId: IndustryType) {
return INDUSTRY_CONFIGS[industryId];
}
/**
* 소개 문구.
*
* 수집·생성된 `intro` fact 만 쓴다. 없으면 빈 값을 돌려주고, 부르는 쪽이
* "아직 소개문이 없습니다"를 그린다 — 남의 문장으로 자리를 메우지 않는다.
*/
export function introParagraph(_industryId: IndustryType, infoFields: InfoField[]): string {
const collected = infoFields.find((f) => f.id === 'intro' || f.id === 'room_intro');
return collected?.value?.trim() ?? '';
}
/**
* 이용 규정으로 읽히는 fact 들. 순서가 곧 화면 순서다.
*
* ★ 스키마에 있는 key 만 적는다. 여기 없는 규정은 만들지 않는다 —
* 예전에는 '체크인 16:00 / 체크아웃 11:00' 같은 가공의 규정이 상수로 박혀 있어
* 모든 사업장 화면에 똑같이 떴다. 사장님은 그게 자기 규정인 줄 알고 발행했다.
*/
const RULE_FIELD_IDS = [
'check_in_time',
'check_out_time',
'cancel_policy',
'cooking_allowed',
'pet_allowed',
'smoking',
'extra_person_fee',
];
/** 확인된 fact 에서만 이용 규정 줄을 만든다. 없으면 빈 목록 — 부르는 쪽이 빈 상태를 그린다. */
export function ruleItems(infoFields: InfoField[]): string[] {
return RULE_FIELD_IDS.map((id) => infoFields.find((f) => f.id === id))
.filter((f): f is InfoField => Boolean(f?.value?.trim()))
.map((f) => `${f.label}: ${f.value.trim()}`);
}
/** 대표 사진. 지정이 없으면 첫 장으로 떨어진다 — 히어로가 빈 채로 나가지 않게. */
export function primaryPhoto(photos: PhotoItem[]) {
return photos.find((p) => p.isPrimary) ?? photos[0];
}
/** 수집된 사진(props)을 갤러리 타일 모양으로. 캡션은 사진 제목을 그대로 쓴다. */
function toTiles(photos: PhotoItem[]): TilePhoto[] {
return photos.map((p) => ({
id: p.id,
url: p.url,
alt: p.title,
caption: p.title,
category: p.category,
}));
}
/** 갤러리에 깔 사진 — 수집된 것만. 없으면 빈 목록이고, 부르는 쪽이 빈 상태를 그린다. */
export function galleryPhotos(_industryId: IndustryType, photos: PhotoItem[]): TilePhoto[] {
return toTiles(photos.filter((photo) => photo.isVisible !== false));
}
/**
* 예약 버튼이 향할 곳.
*
* ★ 실사업장의 예약 채널(place_links)은 SectionRenderProps 로 흘러오지 않는다.
* 그래서 상호 검색으로 떨어뜨린다 — 시연용 예약 링크를 붙이는 것보다 안전하다.
* (확정된 링크를 쓰려면 계약에 채널 URL 을 얹어야 한다.)
*/
export function bookingHref(_industryId: IndustryType, storeName: string) {
return `https://search.naver.com/search.naver?query=${encodeURIComponent(storeName)}`;
}
@@ -0,0 +1,57 @@
/**
* 관람 안내 · 갤러리 — 전시 사진을 크게 깔고 관람 정보를 옆에 붙인다.
*/
import {Clock, Ticket} from 'lucide-react';
import {
FeatureCard,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function ExhibitionGallery(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos, infoFields} = props;
const items = galleryPhotos(industryId, photos).slice(0, 4);
const hours = infoFields.find((f) => f.id === 'operating_hours');
const fee = infoFields.find((f) => f.id === 'admission' || f.id === 'price_range');
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-2 gap-2.5 sm:gap-3">
{items.map((photo) => (
<PhotoTile key={photo.id} photo={photo} fit="landscape" />
))}
</div>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{hours && (
<FeatureCard
icon={Clock}
title="관람 시간"
description={hours.value}
colors={template.colors}
/>
)}
{fee && (
<FeatureCard
icon={Ticket}
title="관람료"
description={fee.value}
colors={template.colors}
/>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,44 @@
/**
* 관람 안내 · 공지 — 사진 없이 안내 문구만. 전시 일정이 자주 바뀌는 곳에 부담이 적다.
*/
import {Info} from 'lucide-react';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function ExhibitionNotice(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, template, infoFields} = props;
const notices = infoFields
.filter((f) => !f.requiresVerification || f.isVerified)
.slice(0, 4);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="eyebrow"
eyebrow="NOTICE"
title={section.name}
trailing={<Info className="size-5 text-stone-400" />}
colors={template.colors}
/>
<div className="space-y-3 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs">
<p className="text-xs leading-relaxed text-stone-600">
{section.body || `${storeName}의 상설 전시와 아트숍은 별도 예약 없이 관람하실 수 있습니다. 기획 전시 일정은 변경될 수 있으니 방문 전 확인해 주세요.`}
</p>
<dl className="space-y-2 border-t border-stone-100 pt-3">
{notices.map((field) => (
<div key={field.id} className="flex gap-3 text-xs">
<dt className="w-20 shrink-0 font-semibold text-stone-400">{field.label}</dt>
<dd className="font-medium text-stone-800" style={{color: template.colors.text}}>
{field.value}
</dd>
</div>
))}
</dl>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,68 @@
/**
* FAQ · 아코디언 — 질문만 보이고 누르면 답이 열린다. 항목이 많아도 화면이 짧다.
*/
import {useState} from 'react';
import {ChevronDown, ChevronUp} from 'lucide-react';
import {ListCard, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqAccordion(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
const [openIdx, setOpenIdx] = useState<number | null>(0);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<ListCard>
{faqs.map((faq, idx) => {
const isOpen = openIdx === idx;
return (
<div key={faq.question}>
<button
type="button"
onClick={(e) => {
e.stopPropagation();
setOpenIdx(isOpen ? null : idx);
}}
aria-expanded={isOpen}
style={{color: template.colors.text}}
className="flex w-full cursor-pointer items-center justify-between gap-3 p-4 text-left text-xs font-bold text-stone-900 hover:bg-stone-50 sm:text-sm"
>
<span className="flex items-center gap-2.5">
<span
className="serif-title font-normal text-stone-400"
style={{color: template.colors.accent}}
>
Q.
</span>
<span>{faq.question}</span>
</span>
{isOpen ? (
<ChevronUp className="size-4 shrink-0 text-stone-400" />
) : (
<ChevronDown className="size-4 shrink-0 text-stone-400" />
)}
</button>
{isOpen && (
<div className="border-t border-stone-50 bg-stone-50/40 px-4 pb-4 pt-1 text-xs leading-relaxed text-stone-600 sm:text-sm">
{faq.answer}
</div>
)}
</div>
);
})}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,50 @@
/**
* FAQ · 펼친 목록 — 질문과 답을 모두 열어 둔다.
* 손님이 클릭 없이 훑고 지나가게 하고 싶을 때(검색 노출에도 유리하다).
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqOpenList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<dl className="space-y-4">
{faqs.map((faq) => (
<div
key={faq.question}
className="space-y-1.5 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs"
>
<dt
className="flex items-start gap-2 text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
<span
className="serif-title font-normal text-stone-400"
style={{color: template.colors.accent}}
>
Q.
</span>
<span>{faq.question}</span>
</dt>
<dd className="flex items-start gap-2 text-xs leading-relaxed text-stone-600 sm:text-sm">
<span className="serif-title font-normal text-stone-300">A.</span>
<span>{faq.answer}</span>
</dd>
</div>
))}
</dl>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,39 @@
/**
* FAQ · 2단 — 넓은 화면에서 두 줄씩 나눠 세로 길이를 반으로 줄인다.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqTwoColumn(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading
variant="centered"
eyebrow="FAQ"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<dl className="grid grid-cols-1 gap-x-8 gap-y-5 md:grid-cols-2">
{faqs.map((faq) => (
<div key={faq.question} className="space-y-1.5 border-t border-stone-200/80 pt-4">
<dt
className="text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
{faq.question}
</dt>
<dd className="text-xs leading-relaxed text-stone-600">{faq.answer}</dd>
</div>
))}
</dl>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,24 @@
import type {IndustryType} from '@o2o/shared';
export interface FaqEntry {
question: string;
answer: string;
}
/**
* FAQ 원본.
*
* ★ 지금은 항상 빈 목록이다. 캔버스 계약(SectionRenderProps)에 FAQ 가 없기 때문이다 —
* 에디터는 구조적으로 실제 FAQ 를 받을 창구가 없다.
*
* ★ 업종 시드 FAQ 를 폴백으로 쓰던 코드를 걷어냈다. 그 안에는 가공의 값이 가격까지 붙어 있었고
* ("숯과 그릴 세트(25,000원)", "기준 2인 초과 시 1인당 30,000원"), 사장님이 팔지도 않는
* 조건을 자기 사이트로 읽었다. 손님이 그 금액으로 오면 클레임이다.
*
* 진짜 FAQ 는 COPY 잡이 **확인된 fact 만 근거로** 만들고 사장님 승인을 거쳐
* 서버(fact.faqs)에 들어간다 — 그게 유일한 출처다. 캔버스로 흘려보내려면
* SectionRenderProps 에 faqs 를 얹어야 한다.
*/
export function faqEntries(_industryId: IndustryType): FaqEntry[] {
return [];
}
@@ -0,0 +1,66 @@
/**
* 히어로 · 에디토리얼 — 상단 브랜드 바 + 큰 사진 + 가운데 세리프 카피.
* 감성 숙소/공방처럼 "분위기부터 보여주고 싶은" 곳의 기본값.
*/
import {Calendar} from 'lucide-react';
import {SectionFrame} from '../../primitives';
import {CtaLink} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, primaryPhoto} from '../common';
export function HeroEditorial(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const cover = primaryPhoto(photos);
// 사진이 없으면 <img> 없이 어두운 판만 남긴다 — 시연용 사진으로 자리를 메우지 않는다.
const coverUrl = cover?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div
className="flex w-full select-none flex-col"
style={{backgroundColor: template.colors.bg}}
>
<div className="mx-auto flex w-full max-w-[1120px] items-center justify-between border-b border-stone-200/60 bg-white/90 px-4 py-4 backdrop-blur-xs sm:px-6">
<span
className="serif-title text-base font-bold uppercase tracking-widest text-stone-800 sm:text-lg"
style={{color: template.colors.text}}
>
{storeName}
</span>
</div>
<div className="relative flex h-[50vh] w-full items-center justify-center overflow-hidden bg-stone-900 sm:h-[65vh]">
{coverUrl && (
<img
src={coverUrl}
alt={storeName}
className="absolute inset-0 size-full object-cover opacity-75"
/>
)}
<div className="absolute inset-0 bg-black/45" />
<div className="relative z-10 mx-auto w-full max-w-xl space-y-4 px-6 text-center text-white">
<h1 className="serif-title text-2xl font-bold leading-tight tracking-tight drop-shadow-xs sm:text-4xl md:text-5xl">
{storeName}
</h1>
<p className="text-xs font-light tracking-wide text-stone-200 sm:text-sm md:text-base">
{section.description || location}
</p>
<div className="flex items-center justify-center gap-2 pt-2">
<CtaLink
href={bookingHref(industryId, storeName)}
variant="pill"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>실시간 예약</span>
</CtaLink>
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,54 @@
/**
* 히어로 · 풀블리드 — 화면을 꽉 채운 사진 위에 왼쪽 아래로 붙는 큰 타이포.
* 사진 한 장의 힘이 강한 곳(뷰 좋은 스테이, 플레이팅이 강한 다이닝)에 맞는다.
*/
import {Calendar, MapPin} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, primaryPhoto} from '../common';
export function HeroFullBleed(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const cover = primaryPhoto(photos);
// 사진이 없으면 <img> 를 아예 렌더하지 않고 어두운 배경만 남긴다.
const coverUrl = cover?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="relative h-[62vh] min-h-[380px] w-full select-none overflow-hidden bg-stone-900 sm:h-[78vh]">
{coverUrl && (
<img
src={coverUrl}
alt={storeName}
className="absolute inset-0 size-full object-cover"
/>
)}
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/25 to-black/10" />
<div className="absolute inset-x-0 bottom-0 px-6 pb-10 sm:px-10 sm:pb-14">
<div className="mx-auto max-w-[1120px] space-y-3 text-white">
<span className="inline-flex items-center gap-1.5 rounded-full border border-white/25 bg-white/10 px-3 py-1 text-[11px] font-medium backdrop-blur-xs">
<MapPin className="size-3" />
{section.description || location}
</span>
<h1 className="serif-title max-w-2xl text-3xl font-bold leading-[1.15] tracking-tight drop-shadow-sm sm:text-5xl md:text-6xl">
{storeName}
</h1>
<div className="flex flex-wrap items-center gap-2 pt-2">
<CtaLink
href={bookingHref(industryId, storeName)}
variant="brand"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>지금 예약하기</span>
</CtaLink>
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,50 @@
/**
* 히어로 · 좌우 분할 — 왼쪽 글, 오른쪽 사진.
* 첫 화면에서 "무엇을 파는 곳인지"를 글로 먼저 읽혀야 하는 업종에 맞는다.
*/
import {SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {industryConfig, primaryPhoto} from '../common';
export function HeroSplit(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const config = industryConfig(industryId);
const cover = primaryPhoto(photos);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="p-6 sm:p-10" style={{backgroundColor: template.colors.bg}}>
<div className="mx-auto grid max-w-4xl grid-cols-1 items-center gap-6 md:grid-cols-12">
<div className="space-y-4 md:col-span-7">
<span
className="inline-flex items-center gap-2 rounded px-2.5 py-1 text-xs font-semibold"
style={{
backgroundColor: `${template.colors.primary}12`,
color: template.colors.primary,
}}
>
<span
className="size-1.5 rounded-full"
style={{backgroundColor: template.colors.primary}}
/>
{section.description || `${config.name} · ${location}`}
</span>
<h1
className="text-2xl font-extrabold leading-tight tracking-tight sm:text-4xl"
style={{color: template.colors.text}}
>
{storeName}
</h1>
</div>
<div className="md:col-span-5">
<div className="relative aspect-4/3 overflow-hidden rounded-lg border border-slate-200/60 shadow-xs">
<img src={cover?.url} alt={storeName} className="size-full object-cover" />
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,47 @@
/**
* 히어로 · 타이포 중심 — 사진 없이 여백과 글자만.
* 쓸 만한 사진이 아직 없거나, 조용한 인상을 주고 싶을 때 고른다.
*/
import {ArrowUpRight} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, industryConfig} from '../common';
export function HeroTypeOnly(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template} = props;
const config = industryConfig(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div
className="px-6 py-20 sm:px-10 sm:py-28"
style={{backgroundColor: template.colors.bg}}
>
<div className="mx-auto max-w-2xl space-y-6 text-center">
<span
className="text-[11px] font-semibold uppercase tracking-[0.35em]"
style={{color: template.colors.accent}}
>
{section.description || `${config.name} · ${location}`}
</span>
<h1
className="serif-title text-3xl font-bold leading-[1.2] tracking-tight sm:text-5xl"
style={{color: template.colors.text}}
>
{storeName}
</h1>
<div className="mx-auto h-px w-12" style={{backgroundColor: template.colors.primary}} />
<div className="flex justify-center pt-2">
<CtaLink href={bookingHref(industryId, storeName)} variant="outline">
<span>{storeName} 둘러보기</span>
<ArrowUpRight className="size-3.5" />
</CtaLink>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,41 @@
/**
* 기본 정보 · 카드 — 항목마다 한 장씩. 모바일에서 손가락으로 훑기 좋다.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-2.5 sm:grid-cols-2">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="card" colors={template.colors} />
))}
</div>
<div className="text-right">
<span className="font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준 정보입니다.</span>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,41 @@
/**
* 기본 정보 · 한 줄 요약 — 값들을 문장처럼 이어 붙인 가장 좁은 형태.
* 정보가 적거나, 아래 섹션으로 빨리 넘기고 싶을 때.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoInline(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="flex flex-wrap gap-x-5 gap-y-2.5 rounded-xl border border-stone-200/70 bg-stone-50/60 p-4">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="inline" colors={template.colors} />
))}
</div>
<span className="block font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준</span>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 기본 정보 · 표 — 라벨과 값을 선으로 나눈 가장 읽기 쉬운 형태.
* 항목이 많아도 눈이 안 흔들린다.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-stone-50/60 [&>*+*]:border-t [&>*+*]:border-stone-200/70">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="row" colors={template.colors} />
))}
</div>
<div className="text-right">
<span className="font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준 정보입니다.</span>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,49 @@
/**
* 문의 · 연락 카드 — 전화 / 카카오 / 인스타로 바로 보낸다.
* 폼을 받을 준비가 안 된 사장님에게는 이쪽이 사고가 없다.
*/
import {Phone} from 'lucide-react';
import {
EmptyStateNotice,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function InquiryCta(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, template} = props;
// ★ 연락처(place_links)는 SectionRenderProps 로 흘러오지 않는다. 값이 생기기 전까지
// 버튼째 숨긴다 — 시연용 번호를 붙이면 남의 가게로 전화가 간다.
const phone = props.infoFields.find((f) => f.id === 'phone')?.value?.trim();
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="narrow">
<SectionHeading variant="centered" title={section.name} subtitle={section.description} />
<div className="flex flex-col items-center gap-3 rounded-2xl border border-stone-200/80 bg-stone-50/70 p-6 text-center">
<p className="text-xs leading-relaxed text-stone-600">
{section.body || `${storeName} 단체·대관 문의는 아래로 연락 주시면 담당자가 안내해 드립니다.`}
</p>
{phone ? (
<div className="flex flex-wrap items-center justify-center gap-2">
<a
href={`tel:${phone}`}
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1.5 rounded-xl px-5 py-2.5 text-xs font-semibold text-white shadow-xs transition-opacity hover:opacity-90"
style={{backgroundColor: template.colors.primary}}
>
<Phone className="size-3.5" />
<span>{phone}</span>
</a>
</div>
) : (
<EmptyStateNotice>연락처는 아직 준비 중입니다.</EmptyStateNotice>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,71 @@
/**
* 문의 · 신청서 — 인원/일정/연락처를 받는 양식.
*
* ★ 캔버스는 미리보기다. 여기서 제출은 실제로 나가지 않는다 —
* 그 사실을 화면에 적어 둬야 사장님이 "접수됐겠지" 하고 넘어가지 않는다.
*/
import {Send} from 'lucide-react';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
const FIELDS = [
{id: 'name', label: '성함 / 단체명', placeholder: '홍길동 / ○○기업 총무팀'},
{id: 'contact', label: '연락처', placeholder: '010-0000-0000'},
{id: 'date', label: '희망 일자', placeholder: '2026-09-14'},
{id: 'headcount', label: '예상 인원', placeholder: '20명'},
];
export function InquiryForm(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading title={section.name} subtitle={section.description} />
<div
onClick={(e) => e.stopPropagation()}
role="presentation"
className="space-y-3 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs"
>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{FIELDS.map((field) => (
<label key={field.id} className="space-y-1">
<span className="block text-[11px] font-semibold text-stone-500">
{field.label}
</span>
<input
type="text"
placeholder={field.placeholder}
className="w-full rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</label>
))}
</div>
<label className="block space-y-1">
<span className="block text-[11px] font-semibold text-stone-500">문의 내용</span>
<textarea
rows={3}
placeholder="행사 성격, 필요한 준비물, 예산 등을 적어 주세요."
className="w-full resize-none rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</label>
<button
type="button"
className="inline-flex w-full cursor-not-allowed items-center justify-center gap-1.5 rounded-xl px-5 py-2.5 text-xs font-semibold text-white opacity-90"
style={{backgroundColor: template.colors.primary}}
>
<Send className="size-3.5" />
<span>문의 보내기</span>
</button>
<p className="text-center text-[10px] text-stone-400">
미리보기 화면입니다 — 실제 접수는 발행 후 동작합니다.
</p>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,35 @@
/**
* 소개 · 가운데 정렬 — 짧은 문단 하나로 끝내는 가장 조용한 구성.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {EmptyStateNotice} from '../../primitives';
import {introParagraph} from '../common';
export function IntroCentered(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="centered"
eyebrow="ABOUT US"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
{intro ? (
<p className="text-center text-xs leading-relaxed text-stone-600 sm:text-sm">
{intro}
</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,48 @@
/**
* 소개 · 사진 옆 글 — 왼쪽 세로 사진, 오른쪽 문단 + 특징 목록.
* 사진과 설명을 같은 눈높이에서 함께 읽히고 싶을 때.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {primaryPhoto, introParagraph} from '../common';
export function IntroSideBySide(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template, photos} = props;
const shot = photos[1] ?? primaryPhoto(photos);
// 사진이 없으면 회색 판만 남기고 <img> 는 렌더하지 않는다.
const shotUrl = shot?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="ABOUT"
title={section.name}
subtitle={section.description}
/>
<div className="grid grid-cols-1 items-center gap-6 md:grid-cols-12">
<div className="md:col-span-5">
<div className="relative aspect-3/4 overflow-hidden rounded-2xl border border-stone-200/80 bg-stone-100">
{shotUrl && (
<img src={shotUrl} alt={`${storeName} 공간`} className="size-full object-cover" />
)}
</div>
</div>
<div className="space-y-4 md:col-span-7">
{intro ? (
<p className="text-xs leading-relaxed text-stone-700 sm:text-sm">{intro}</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</div>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 소개 · 스토리 — 넓은 사진 한 장 아래로 문단이 흐르는 잡지식 구성.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {introParagraph} from '../common';
export function IntroStory(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template, photos} = props;
const shotUrl = photos[1]?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="relative aspect-16/9 overflow-hidden rounded-xl border border-stone-200/80 bg-stone-100 sm:aspect-21/9">
{shotUrl && (
<img src={shotUrl} alt={`${storeName} 공간`} className="size-full object-cover" />
)}
</div>
<div className="space-y-4">
{intro ? (
<p className="font-sans text-xs leading-relaxed text-stone-700 sm:text-base">
{intro}
</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,27 @@
import {useEffect, useState} from 'react';
/** "실시간 업데이트: 오후 4:41:56" 표시. 1초마다 갱신된다. */
export function LiveClock() {
const [clock, setClock] = useState('');
useEffect(() => {
const update = () => {
const now = new Date();
const period = now.getHours() >= 12 ? '오후' : '오전';
const hours = now.getHours() % 12 || 12;
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
setClock(`${period} ${hours}:${minutes}:${seconds}`);
};
update();
const timer = setInterval(update, 1000);
return () => clearInterval(timer);
}, []);
return (
<span className="flex items-center gap-1.5 rounded-full border border-stone-200/80 bg-white px-2.5 py-1 text-[11px] text-stone-500 shadow-2xs">
<span className="size-1.5 animate-pulse rounded-full bg-emerald-500" />
<span>실시간 업데이트: {clock}</span>
</span>
);
}
@@ -0,0 +1,50 @@
/**
* 지역 가이드 · 요약 — 날씨 한 줄과 추천 6곳만.
* 지역 정보가 주인공이 아닌 사이트에서 "있긴 하다" 정도로 둘 때.
*/
import {
EmptyStateNotice,
ListCard,
PlaceRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
export function LocalCompact(props: SectionRenderProps) {
const {section, isSelected, onSelect, location, template} = props;
// 맛집·명소를 섞어 딱 6개만. 목록이 길어지면 요약이 아니게 된다.
// ★ 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약(SectionRenderProps)에 없다.
// 시연용 목록(제주 애월)으로 자리를 메우지 않는다 — 남의 동네 맛집이 사장님 사이트에 붙는다.
const picks: {name: string; meta: string; description: string; q: string}[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title="주변 안내" colors={template.colors} />
{picks.length === 0 ? (
<EmptyStateNotice>주변 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{picks.map((p) => (
<PlaceRow
key={p.name}
name={p.name}
meta={p.meta}
description={p.description}
href={naverSearch(p.q)}
actionLabel="보기"
colors={template.colors}
/>
))}
</ListCard>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,163 @@
/**
* 지역 가이드 · 전체 — 날씨 카드 + 맛집 + 명소 + 월별 축제를 세로로 전부.
* "여기 오면 근처에 뭐가 있나"를 한 화면에서 다 보여주고 싶을 때.
*/
import {Calendar, MapPin, Sparkles, Utensils} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {
EmptyStateNotice,
ListCard,
PlaceRow,
Pill,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {LiveClock} from './LiveClock';
import type {FestivalItem, NearbyPlace} from './types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
function GroupHeading({
icon: Icon,
title,
note,
colors,
}: {
icon: typeof Utensils;
title: string;
note: string;
colors: TemplateItem['colors'];
}) {
return (
<div className="flex items-center justify-between">
<h3
className="serif-title flex items-center gap-2 text-base font-bold text-stone-900 sm:text-lg"
style={{color: colors.text}}
>
<Icon className="size-4 text-stone-600" style={{color: colors.primary}} />
<span>{title}</span>
</h3>
{/* 오른쪽 출처 문구는 부가 정보라 중립 회색 그대로 둔다. */}
<span className="text-[11px] text-stone-400">{note}</span>
</div>
);
}
export function LocalFull(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, location, template} = props;
const isStay = industryId === 'stay';
const locName = location.split(' ')[0] || '주변';
// ★ 맛집·명소·축제는 전부 제주 애월 시연용 목록이다 — 실사업장은 빈 목록으로 떨어진다.
// (지역 큐레이션을 읽어올 백엔드 창구가 아직 없어 당분간 계속 빈다.)
// 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약에 없다 — 시연용 목록을 깔지 않는다.
const foods: NearbyPlace[] = [];
const spots: NearbyPlace[] = [];
const festivals: FestivalItem[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody className="space-y-8">
<SectionHeading
variant="eyebrow"
eyebrow="AI Local Guide"
title={`AI ${locName} 실시간 가이드`}
subtitle="실시간 날씨와 인근 미식·명소·축제를 AI가 큐레이션합니다"
trailing={<LiveClock />}
colors={template.colors}
/>
<div className="space-y-3.5">
<GroupHeading
icon={Utensils}
title="숙소 인근 엄선 맛집 & 카페"
note="호스트 & 네이버 플레이스 연동"
colors={template.colors}
/>
{foods.length === 0 ? (
<EmptyStateNotice>주변 맛집·카페 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{foods.map((place) => (
<PlaceRow
key={place.name}
name={place.name}
meta={place.distance}
description={place.description}
href={naverSearch(place.searchQuery)}
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
<div className="space-y-3.5">
<GroupHeading
icon={MapPin}
title="주변 힐링 명소 & 해변"
note="차량 5~20분 거리"
colors={template.colors}
/>
{spots.length === 0 ? (
<EmptyStateNotice>주변 명소 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{spots.map((spot) => (
<PlaceRow
key={spot.name}
name={spot.name}
meta={spot.duration}
description={spot.description}
href={naverSearch(spot.searchQuery)}
actionLabel="상세정보"
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
{isStay && (
<div className="space-y-3.5">
<GroupHeading
icon={Calendar}
title="월별 축제 & 문화 행사"
note="사계절 캘린더"
colors={template.colors}
/>
{festivals.length === 0 ? (
<EmptyStateNotice>월별 축제 안내는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{festivals.map((fest) => (
<PlaceRow
key={fest.name}
name={fest.name}
description={fest.description || fest.period}
href={naverSearch(fest.searchQuery)}
actionLabel="검색"
leading={
<>
<Pill tone="accent">{fest.month}</Pill>
{fest.isFeatured && (
<Pill tone="good">
<Sparkles className="size-2.5" />
대표축제
</Pill>
)}
</>
}
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,124 @@
/**
* 지역 가이드 · 탭 — 맛집/명소/축제를 탭으로 갈아 끼운다.
* 목록이 길어 스크롤이 부담스러울 때 화면 길이를 1/3 로 줄인다.
*/
import {useState} from 'react';
import {Calendar, MapPin, Utensils} from 'lucide-react';
import {cn} from '@/lib/utils';
import {
EmptyStateNotice,
ListCard,
Pill,
PlaceRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import type {FestivalItem, NearbyPlace} from './types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
type TabKey = 'food' | 'spots' | 'festivals';
const TABS: {key: TabKey; label: string; icon: typeof Utensils}[] = [
{key: 'food', label: '맛집 · 카페', icon: Utensils},
{key: 'spots', label: '명소', icon: MapPin},
{key: 'festivals', label: '축제', icon: Calendar},
];
export function LocalTabs(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, location, template} = props;
const [tab, setTab] = useState<TabKey>('food');
const isStay = industryId === 'stay';
const tabs = isStay ? TABS : TABS.filter((t) => t.key !== 'festivals');
const locName = location.split(' ')[0] || '주변';
// ★ 세 탭 모두 제주 애월 시연용 목록이다 — 실사업장은 빈 목록으로 떨어진다.
// 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약에 없다 — 시연용 목록을 깔지 않는다.
const foods: NearbyPlace[] = [];
const spots: NearbyPlace[] = [];
const festivals: FestivalItem[] = [];
// 탭을 눌렀는데 아무것도 없으면 섹션이 사라진 것처럼 보인다 — 자리는 지키고 상태만 알린다.
const isEmpty = (tab === 'food' ? foods : tab === 'spots' ? spots : festivals).length === 0;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="AI Local Guide"
title={`AI ${locName} 실시간 가이드`}
subtitle="탭을 눌러 원하는 정보만 보세요"
colors={template.colors}
/>
<div className="flex items-center gap-1 rounded-xl border border-stone-200/80 bg-white p-1">
{tabs.map(({key, label, icon: Icon}) => (
<button
key={key}
type="button"
onClick={(e) => {
e.stopPropagation();
setTab(key);
}}
aria-pressed={tab === key}
style={tab === key ? {backgroundColor: template.colors.primary} : undefined}
className={cn(
'flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-colors',
tab === key ? 'text-white' : 'text-stone-500 hover:bg-stone-100',
)}
>
<Icon className="size-3.5" />
<span>{label}</span>
</button>
))}
</div>
{isEmpty ? (
<EmptyStateNotice>주변 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{tab === 'food' &&
foods.map((place) => (
<PlaceRow
key={place.name}
name={place.name}
meta={place.distance}
description={place.description}
href={naverSearch(place.searchQuery)}
colors={template.colors}
/>
))}
{tab === 'spots' &&
spots.map((spot) => (
<PlaceRow
key={spot.name}
name={spot.name}
meta={spot.duration}
description={spot.description}
href={naverSearch(spot.searchQuery)}
actionLabel="상세정보"
colors={template.colors}
/>
))}
{tab === 'festivals' &&
festivals.map((fest) => (
<PlaceRow
key={fest.name}
name={fest.name}
description={fest.description || fest.period}
href={naverSearch(fest.searchQuery)}
actionLabel="검색"
leading={<Pill tone="accent">{fest.month}</Pill>}
colors={template.colors}
/>
))}
</ListCard>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,126 @@
/**
* 실시간 날씨 + AI 추천 한 덩어리.
*
* 지역 가이드 배리에이션 셋이 전부 이걸 쓴다 — 날씨 조회를 배리에이션마다 하면
* 레이아웃을 바꿀 때마다 API 를 다시 때린다.
*/
import {ArrowUpRight, Cloud, CloudRain, Snowflake, Sparkles, Sun} from 'lucide-react';
import {useWeather} from '@/hooks/useWeather';
import {cn} from '@/lib/utils';
import type {WeatherLocation} from '@/stores/builder';
import {EmptyStateNotice} from '../../primitives';
function WeatherIcon({condition, className}: {condition: string; className?: string}) {
switch (condition) {
case '맑음':
return <Sun className={cn('text-amber-500', className)} />;
case '구름많음':
return <Cloud className={cn('text-stone-500', className)} />;
case '비':
return <CloudRain className={cn('text-blue-500', className)} />;
case '눈':
return <Snowflake className={cn('text-cyan-400', className)} />;
default:
return <Cloud className={cn('text-stone-400', className)} />;
}
}
export function WeatherPanel({
location,
weatherLocation,
dense,
}: {
location: string;
weatherLocation?: WeatherLocation;
dense?: boolean;
}) {
const observed = useWeather(
weatherLocation?.regionCode,
weatherLocation?.latitude,
weatherLocation?.longitude,
);
const weather = weatherLocation ? observed : null;
if (dense) {
return (
<div className="flex flex-wrap items-center gap-3 rounded-xl border border-stone-200/80 bg-white px-4 py-3 shadow-2xs">
{weather ? (
<>
<WeatherIcon condition={weather.condition} className="size-5" />
<span className="text-lg font-extrabold tracking-tight text-stone-900">
{weather.temperature || '21.4'}°C
</span>
<span className="text-xs font-semibold text-stone-600">
{weather.condition || '구름많음'}
</span>
{weather.stale && <span className="text-[10px] text-amber-700">최근 관측값</span>}
<span className="min-w-0 flex-1 truncate text-[11px] text-stone-500">
{weather.recommendation}
</span>
</>
) : (
<span className="text-[11px] text-stone-500">
실시간 날씨는 아직 준비 중입니다.
</span>
)}
</div>
);
}
return (
<div className="space-y-4 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs sm:p-6">
<div className="flex flex-col justify-between gap-3 border-b border-stone-100 pb-4 sm:flex-row sm:items-center">
<div className="flex items-center gap-3.5">
<div className="flex size-12 shrink-0 items-center justify-center rounded-2xl bg-stone-100/80">
<WeatherIcon condition={weather?.condition ?? ''} className="size-6" />
</div>
<div>
<span className="block text-[11px] font-semibold text-stone-400">
{location || '제주 애월읍'} 실시간 기상
</span>
{weather ? (
<div className="mt-0.5 flex items-baseline gap-2">
<span className="font-sans text-2xl font-extrabold tracking-tight text-stone-900 sm:text-3xl">
{weather.temperature || '21.4'}°C
</span>
<span className="text-xs font-semibold text-stone-700 sm:text-sm">
{weather.condition || '구름많음'}
</span>
{weather.stale && (
<span className="text-[10px] font-medium text-amber-700">최근 관측값</span>
)}
</div>
) : (
<span className="mt-0.5 block text-xs text-stone-500">
실시간 날씨는 아직 준비 중입니다.
</span>
)}
</div>
</div>
<a
href={`https://search.naver.com/search.naver?query=${encodeURIComponent(`${location} 날씨`)}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="flex items-center gap-1 self-start rounded-lg border border-stone-200/60 bg-stone-50 px-3 py-1.5 text-xs text-stone-500 transition-colors hover:bg-stone-100 hover:text-stone-900 sm:self-auto"
>
<span>주간 날씨 예보</span>
<ArrowUpRight className="size-3.5" />
</a>
</div>
{weather ? (
<div className="flex items-start gap-2.5 rounded-xl border border-stone-200/60 bg-stone-50/70 p-3.5 text-xs leading-relaxed text-stone-700 sm:text-sm">
<Sparkles className="mt-0.5 size-4 shrink-0 text-amber-600" />
<div>
<strong className="font-semibold text-stone-900">AI 맞춤 추천: </strong>
<span>{weather.recommendation}</span>
</div>
</div>
) : (
<EmptyStateNotice>날씨 기반 AI 추천은 아직 준비 중입니다.</EmptyStateNotice>
)}
</div>
);
}
@@ -0,0 +1,32 @@
/**
* 지역 정보 항목의 모양.
*
* ★ 원래 이 타입들은 시연용 데이터 파일(data/stayData.ts)이 소유했다. 그 파일을 지우면서
* 실제로 쓰는 쪽인 여기로 옮겼다 — 타입이 데이터 시드에 매여 있을 이유가 없다.
*
* ★ 값은 서버(local.local_contents)가 소유한다. 지금은 캔버스 계약(SectionRenderProps)에
* 지역 정보가 없어서 배리에이션들이 빈 목록을 그린다. 흘려보낼 창구가 생기면
* 이 모양에 맞춰 매핑하면 된다.
*/
export interface NearbyPlace {
name: string;
category: string;
/** 거리 표기("차로 5분", "1.2km") — 원문 그대로 옮긴다. */
distance: string;
duration: string;
description: string;
/** 상세 페이지 대신 검색으로 보낸다 — 없는 주소를 지어내지 않기 위해서다. */
searchQuery: string;
tag: string;
}
export interface FestivalItem {
month: string;
name: string;
period: string;
location: string;
description: string;
isFeatured?: boolean;
officialUrl?: string;
searchQuery: string;
}
@@ -0,0 +1,50 @@
/**
* 오시는 길 · 간단 — 주소 한 줄과 길찾기 버튼만.
* 도심처럼 "주소만 알면 찾아오는" 곳이면 표까지 깔 이유가 없다.
*/
import {MapPin} from 'lucide-react';
import {
AddressCard,
EmptyStateNotice,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function MapCompact(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, location, template, infoFields} = props;
// ★ props 로 온 주소만 쓴다. 없으면 카드 대신 준비 중 안내를 둔다 —
// 시연용 주소로 떨어지면 손님을 남의 집으로 보낸다.
const address = infoFields.find((f) => f.id === 'address')?.value ?? '';
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title={section.name}
subtitle={section.description}
trailing={
<span className="flex items-center gap-1 text-[11px] text-stone-500">
<MapPin className="size-3.5" />
{location}
</span>
}
colors={template.colors}
/>
{address ? (
<AddressCard
address={address}
searchName={storeName}
variant="bar"
colors={template.colors}
/>
) : (
<EmptyStateNotice>주소는 아직 준비 중입니다.</EmptyStateNotice>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,111 @@
/**
* 오시는 길 · 상세 — 주소 카드 + 거점별 소요시간 표 + 주차/충전 안내.
* 차로 찾아오는 손님이 많은 곳(외곽 스테이, 교외 카페)에 맞는다.
*/
import {Car, CarFront, Zap} from 'lucide-react';
import {
AddressCard,
EmptyStateNotice,
FeatureCard,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function MapDetailed(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template, infoFields} = props;
// ★ 주소도 소요시간표도 시연용(제주 애월)이다 — 실사업장에는 한 줄도 내보내지 않는다.
const address =
infoFields.find((f) => f.id === 'address')?.value ?? '';
/**
* 소요시간 표.
*
* ★ 서버(local.routes)의 산출물이고 캔버스 계약(SectionRenderProps)에 없다 —
* 흘러올 창구가 생기기 전까지 빈다. 시연용 표(제주 애월 기준)를 깔지 않는다:
* 남의 동네 소요시간을 보고 손님이 출발 시각을 정한다.
*/
const travelTimes: {
destination: string;
byCar: string;
byWalkOrTransit: string;
distance: string;
}[] = [];
const isStay = industryId === 'stay';
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
{address ? (
<AddressCard
address={address}
searchName={storeName}
colors={template.colors}
/>
) : (
<EmptyStateNotice>주소는 아직 준비 중입니다.</EmptyStateNotice>
)}
{isStay && travelTimes.length === 0 && (
<EmptyStateNotice>주요 거점 소요시간은 아직 준비 중입니다.</EmptyStateNotice>
)}
{isStay && travelTimes.length > 0 && (
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-white shadow-2xs">
<div className="flex items-center gap-2 border-b border-stone-200 bg-stone-50 p-3.5 text-xs font-bold text-stone-800">
<Car className="size-4 text-stone-700" />
<span>주요 거점 이동 소요시간</span>
</div>
<div className="overflow-x-auto">
<table className="w-full text-left text-xs">
<thead className="border-b border-stone-100 bg-stone-50/50 font-medium text-stone-500">
<tr>
<th className="p-3">목적지</th>
<th className="p-3">차량</th>
<th className="p-3">도보 / 대중교통</th>
<th className="hidden p-3 sm:table-cell">거리</th>
</tr>
</thead>
<tbody className="text-stone-700 [&>tr+tr]:border-t [&>tr+tr]:border-stone-100">
{travelTimes.map((row) => (
<tr key={row.destination} className="hover:bg-stone-50/50">
<td className="p-3 font-bold text-stone-900">{row.destination}</td>
<td
className="p-3 font-semibold"
style={{color: template.colors.primary}}
>
{row.byCar}
</td>
<td className="p-3">{row.byWalkOrTransit}</td>
<td className="hidden p-3 font-mono text-stone-400 sm:table-cell">
{row.distance}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
)}
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<FeatureCard
icon={CarFront}
title="전용 주차장 완비"
description="객실동 입구 전용 주차 공간 4대 무료 이용 가능"
colors={template.colors}
/>
<FeatureCard
icon={Zap}
title="전기차 완속 충전기"
description="스테이 전용 7kW 완속 충전기 1기 구비"
iconClassName="text-emerald-600"
colors={template.colors}
/>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,31 @@
/**
* 메뉴 · 카드 격자 — 설명을 넉넉히 보여준다. 시그니처가 몇 개뿐일 때 강하다.
*/
import {PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuGrid(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
variant="centered"
eyebrow="MENU"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{items.map((item) => (
<PriceRow key={item.name} item={item} variant="card" colors={template.colors} />
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,29 @@
/**
* 메뉴 · 목록 — 이름과 가격을 한 줄씩. 종이 메뉴판처럼 읽힌다.
*/
import {ListCard, PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<ListCard>
{items.map((item) => (
<PriceRow key={item.name} item={item} colors={template.colors} />
))}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,45 @@
/**
* 메뉴 · 가격표 — 이름과 가격만 점선으로 이어 붙인 가장 압축된 형태.
* 품목이 많은 곳(코스 여러 개, 음료 다수)에 맞는다.
*/
import {Pill, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuPriceTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<ul className="space-y-3.5">
{items.map((item) => (
<li key={item.name} className="space-y-0.5">
<div className="flex items-baseline gap-2">
<span
className="flex items-center gap-2 text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
{item.name}
{item.tag && <Pill tone="accent">{item.tag}</Pill>}
</span>
{/* 점선 리더 — 이름과 가격 사이를 눈으로 잇는다. 선 자체는 중립 회색으로 둔다. */}
<span className="min-w-4 flex-1 translate-y-[-3px] border-b border-dotted border-stone-300" />
<span
className="font-mono text-xs font-extrabold text-stone-900 sm:text-sm"
style={{color: template.colors.primary}}
>
{item.price}
</span>
</div>
{item.desc && <p className="text-[11px] leading-relaxed text-stone-500">{item.desc}</p>}
</li>
))}
</ul>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,13 @@
import type {IndustryType} from '@o2o/shared';
import type {PricedItem} from '../../primitives';
/**
* 메뉴.
*
* ★ 지금은 항상 빈 목록이다. 메뉴는 unit(하위 단위)이고, 캔버스 계약에 units 가 없다.
* 업종 시드의 menuList/courseList 를 폴백으로 쓰던 코드를 걷어냈다 —
* "포레스트 크림라떼 7,500원" 이 실제로 모든 카페 화면에 떴다.
*/
export function menuItems(_industryId: IndustryType): PricedItem[] {
return [];
}
@@ -0,0 +1,52 @@
/**
* 사진 · 가로 슬라이드 — 큰 사진을 한 장씩 넘겨 본다.
* 장수가 적고 한 장 한 장이 좋을 때 가장 세게 보인다.
*/
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>
);
}
@@ -0,0 +1,39 @@
/**
* 사진 · 정사각 격자 — 모든 사진을 같은 크기로. 장수가 많을수록 정돈돼 보인다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosGrid(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>
<SectionHeading
title={section.name}
subtitle={section.description || `사진 ${items.length}장 · 클릭하면 크게 보입니다`}
colors={template.colors}
/>
<div className="grid grid-cols-2 gap-2.5 sm:grid-cols-3 sm:gap-3 md:grid-cols-4">
{items.map((photo, idx) => (
<PhotoTile key={photo.id} photo={photo} fit="square" onOpen={() => setOpenIndex(idx)} />
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}
@@ -0,0 +1,49 @@
/**
* 사진 · 벽돌쌓기 — 세로/가로 비율을 살려 어긋나게 쌓는다.
* 사진마다 구도가 다를 때 잘라내지 않고 보여줄 수 있다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosMasonry(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="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="GALLERY"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
{/* columns 로 쌓으면 사진 높이를 자르지 않고도 빈틈 없이 채워진다. */}
<div className="columns-2 gap-2.5 sm:columns-3 sm:gap-3 [&>*]:mb-2.5 sm:[&>*]:mb-3">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="free"
onOpen={() => setOpenIndex(idx)}
className="break-inside-avoid"
/>
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}
@@ -0,0 +1,169 @@
/**
* 사진 · 사진 + 영상 — 격자 갤러리 아래에 YouTube 영상을 붙인다.
* 릴스·유튜브로 이미 알려진 곳이면 사진보다 영상이 더 잘 판다.
*/
import {useState} from 'react';
import {Plus} from 'lucide-react';
import {convertYouTubeToEmbed} from '@/lib/youtube';
import {
EmptyStateNotice,
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
import {VideoCard, type VideoItem} from './VideoCard';
export function PhotosWithVideos(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
// 영상은 사장님이 이 화면에서 직접 추가한 것만 있다 — 시연용 목록을 깔지 않는다.
const [added, setAdded] = useState<VideoItem[]>([]);
const [removedIds, setRemovedIds] = useState<string[]>([]);
const videos = added.filter((v) => !removedIds.includes(v.id));
const [playingId, setPlayingId] = useState<string | null>(null);
const [isFormOpen, setIsFormOpen] = useState(false);
const [inputTitle, setInputTitle] = useState('');
const [inputUrl, setInputUrl] = useState('');
const [errorMsg, setErrorMsg] = useState('');
const handleAddVideo = (e: React.FormEvent) => {
e.preventDefault();
setErrorMsg('');
if (!inputTitle.trim() || !inputUrl.trim()) {
setErrorMsg('제목과 YouTube URL을 모두 입력해주세요.');
return;
}
const {embedUrl, isValid} = convertYouTubeToEmbed(inputUrl);
if (!isValid || !embedUrl) {
setErrorMsg('올바른 YouTube URL 형식이 아닙니다.');
return;
}
setAdded((prev) => [
{id: `canvas-v-${Date.now()}`, title: inputTitle.trim(), videoUrl: inputUrl.trim(), embedUrl},
...prev,
]);
setInputTitle('');
setInputUrl('');
setIsFormOpen(false);
};
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody className="space-y-8">
<div className="space-y-6">
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="grid grid-cols-2 gap-2.5 sm:grid-cols-3 sm:gap-3 md:grid-cols-4">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="square"
onOpen={() => setOpenIndex(idx)}
/>
))}
</div>
</div>
<div className="space-y-6">
<SectionHeading
title="영상 갤러리"
subtitle="공간의 분위기를 영상으로 미리 확인해 보세요"
trailing={
<button
type="button"
title="영상 추가"
onClick={(e) => {
e.stopPropagation();
setIsFormOpen((v) => !v);
}}
className="flex size-8 cursor-pointer items-center justify-center rounded-full border border-stone-300 bg-white text-stone-700 shadow-2xs transition-colors hover:bg-stone-100 hover:text-stone-900"
>
<Plus className="size-4" />
</button>
}
colors={template.colors}
/>
{isFormOpen && (
<div
onClick={(e) => e.stopPropagation()}
role="presentation"
className="rounded-xl border border-stone-200 bg-white p-4 shadow-xs"
>
<form onSubmit={handleAddVideo} className="space-y-3">
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<input
type="text"
value={inputTitle}
onChange={(e) => setInputTitle(e.target.value)}
placeholder="영상 제목 (예: 스테이의 아침)"
className="rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
<input
type="text"
value={inputUrl}
onChange={(e) => setInputUrl(e.target.value)}
placeholder="YouTube URL (https://www.youtube.com/watch?v=...)"
className="rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</div>
{errorMsg && <p className="text-[11px] text-rose-600">{errorMsg}</p>}
<div className="flex justify-end gap-2">
<button
type="button"
onClick={() => setIsFormOpen(false)}
className="cursor-pointer rounded-lg px-3 py-1.5 text-xs text-stone-500 hover:bg-stone-100"
>
취소
</button>
<button
type="submit"
className="cursor-pointer rounded-lg px-4 py-1.5 text-xs font-semibold text-white"
style={{backgroundColor: template.colors.primary}}
>
등록
</button>
</div>
</form>
</div>
)}
{videos.length === 0 ? (
<EmptyStateNotice>
등록된 영상이 아직 없습니다. + 버튼으로 추가할 수 있습니다.
</EmptyStateNotice>
) : (
<div className="grid grid-cols-1 gap-5 md:grid-cols-2">
{videos.map((video) => (
<VideoCard
key={video.id}
video={video}
isPlaying={playingId === video.id}
onPlay={() => setPlayingId(video.id)}
onRemove={() => setRemovedIds((prev) => [...prev, video.id])}
/>
))}
</div>
)}
</div>
</SectionBody>
<Lightbox
photos={items}
index={openIndex}
onClose={() => setOpenIndex(null)}
onMove={setOpenIndex}
/>
</SectionFrame>
);
}
@@ -0,0 +1,108 @@
import {ExternalLink, Trash2} from 'lucide-react';
/**
* 영상 한 건. 원래 시연용 데이터 파일이 소유하던 타입을 실제로 쓰는 여기로 옮겼다.
*/
export interface VideoItem {
id: string;
title: string;
videoUrl: string;
embedUrl: string;
duration?: string;
}
/** URL 에서 YouTube 영상 id 를 뽑는다. 못 뽑으면 썸네일을 대체 이미지로 떨어뜨린다. */
export function youTubeId(url: string): string | null {
const match = url.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);
return match && match[2].length === 11 ? match[2] : null;
}
const FALLBACK_THUMB =
'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?auto=format&fit=crop&w=800&q=80';
/** 영상 한 칸 — 썸네일을 누르면 그 자리에서 iframe 으로 바뀐다. */
export function VideoCard({
video,
isPlaying,
onPlay,
onRemove,
}: {
video: VideoItem;
isPlaying: boolean;
onPlay: () => void;
onRemove: () => void;
}) {
const ytId = youTubeId(video.videoUrl || video.embedUrl || '');
const thumb = ytId ? `https://img.youtube.com/vi/${ytId}/hqdefault.jpg` : FALLBACK_THUMB;
return (
<div className="flex flex-col overflow-hidden rounded-xl border border-stone-200/90 bg-white shadow-2xs">
<div className="group relative aspect-16/9 overflow-hidden bg-stone-900">
{isPlaying ? (
<iframe
src={`${video.embedUrl}?autoplay=1&rel=0`}
title={video.title}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
className="absolute inset-0 size-full border-0"
/>
) : (
<div
onClick={(e) => {
e.stopPropagation();
onPlay();
}}
className="absolute inset-0 cursor-pointer"
>
<img
src={thumb}
alt={video.title}
className="size-full object-cover opacity-90 transition-transform duration-300 group-hover:scale-105"
/>
<div className="absolute inset-0 flex items-center justify-center bg-black/40 transition-colors group-hover:bg-black/30">
<div className="flex size-12 items-center justify-center rounded-full bg-white/90 pl-1 text-stone-900 shadow-lg transition-transform group-hover:scale-110 group-active:scale-95">
<svg className="size-5 fill-current" viewBox="0 0 24 24">
<path d="M8 5v14l11-7z" />
</svg>
</div>
</div>
<div className="absolute left-3 top-3 flex items-center gap-1.5 rounded-md bg-black/60 px-2 py-1 text-[10px] font-medium text-white backdrop-blur-xs">
<span className="size-2 rounded-full bg-rose-500" />
<span>YouTube</span>
</div>
</div>
)}
</div>
<div className="flex items-center justify-between gap-2 border-t border-stone-100 bg-white p-3.5">
<span className="truncate text-xs font-semibold text-stone-900 sm:text-sm">
{video.title}
</span>
<div className="flex shrink-0 items-center gap-1">
<a
href={video.videoUrl || `https://www.youtube.com/watch?v=${ytId}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
title="YouTube에서 열기"
className="rounded p-1 text-stone-400 hover:text-stone-700"
>
<ExternalLink className="size-3.5" />
</a>
<button
type="button"
title="삭제"
onClick={(e) => {
e.stopPropagation();
onRemove();
}}
className="cursor-pointer p-1 text-stone-400 hover:text-rose-600"
>
<Trash2 className="size-3.5" />
</button>
</div>
</div>
</div>
);
}
@@ -0,0 +1,29 @@
/**
* 체험 프로그램 · 카드 — 소요시간·대상까지 붙여 한 장씩. 처음 오는 손님이 고르기 쉽다.
*/
import {PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {programItems} from './useProgramItems';
export function ProgramsCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = programItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
{items.map((item) => (
<PriceRow key={item.name} item={item} variant="card" colors={template.colors} />
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,60 @@
/**
* 체험 프로그램 · 표 — 프로그램/시간/대상/가격을 열로 세워 비교시킨다.
* 정규 클래스처럼 조건을 견줘 고르는 곳에 맞는다.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {programItems} from './useProgramItems';
export function ProgramsTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = programItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-white shadow-2xs">
<div className="overflow-x-auto">
<table className="w-full text-left text-xs">
<thead className="border-b border-stone-100 bg-stone-50/60 font-medium text-stone-500">
<tr>
<th className="p-3">프로그램</th>
<th className="hidden p-3 sm:table-cell">소요 · 대상</th>
<th className="p-3 text-right">참가비</th>
</tr>
</thead>
<tbody className="text-stone-700 [&>tr+tr]:border-t [&>tr+tr]:border-stone-100">
{items.map((item) => (
<tr key={item.name} className="hover:bg-stone-50/50">
<td className="p-3">
<span
className="block font-bold text-stone-900"
style={{color: template.colors.text}}
>
{item.name}
</span>
{item.desc && (
<span className="mt-0.5 block text-[11px] text-stone-500">{item.desc}</span>
)}
</td>
<td className="hidden p-3 text-[11px] text-stone-500 sm:table-cell">
{item.meta?.join(' · ')}
</td>
<td
className="p-3 text-right font-mono font-extrabold text-stone-900"
style={{color: template.colors.primary}}
>
{item.price}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,13 @@
import type {IndustryType} from '@o2o/shared';
import type {PricedItem} from '../../primitives';
/**
* 체험 프로그램.
*
* ★ 지금은 항상 빈 목록이다. 프로그램은 unit(하위 단위)이고, 캔버스 계약에 units 가 없다.
* 업종 시드의 programList 를 폴백으로 쓰던 코드를 걷어냈다 — 가공의 상품이 가격까지
* 붙어 모든 사업장 화면에 똑같이 떴다.
*/
export function programItems(_industryId: IndustryType): PricedItem[] {
return [];
}
@@ -0,0 +1,169 @@
/**
* 객실 한 칸.
*
* 슬라이드든 격자든 목록이든 "객실 한 개"를 보여주는 방식은 같아야 한다 —
* 카드 안쪽이 배리에이션마다 다르면 사장님이 레이아웃을 바꿀 때 정보가 사라진 것처럼 보인다.
*/
import {ExternalLink, Sparkles} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
import {CtaLink, Pill} from '../../primitives';
/**
* 객실 한 건.
*
* ★ 이 타입은 원래 시연용 데이터 파일(data/stayData.ts)이 소유했다. 그 파일을 지우면서
* 실제로 쓰는 쪽인 여기로 옮겼다 — 타입이 데이터 시드에 매여 있을 이유가 없다.
* 서버 unit 이 캔버스로 흘러오게 되면 이 모양에 맞춰 매핑하면 된다.
*/
export interface Room {
slug: string;
name: string;
subName: string;
type: string;
capacity: string;
bedInfo: string;
size: string;
price: string;
weekdayPrice: string;
weekendPrice: string;
/** 다른 객실과의 차이 한 줄 */
difference: string;
description: string;
features: string[];
amenities: string[];
images: {url: string; alt: string}[];
}
export function RoomCard({
room,
index,
total,
bookingUrl,
layout = 'card',
colors,
className,
}: {
room: Room;
index: number;
total: number;
bookingUrl: string;
/** card = 사진 위 / 정보 아래, row = 사진 왼쪽 / 정보 오른쪽 */
layout?: 'card' | 'row';
/**
* 템플릿 색 토큰. 객실명·요금·예약 버튼이 브랜드 색을 따른다.
*
* ★ "차별점" 상자의 호박색은 그대로 둔다 — 카드 안에서 유일하게 눈을 끄는 자리라,
* 토큰을 먹이면 제목·요금과 같은 색이 되어 강조가 사라진다.
*/
colors?: TemplateItem['colors'];
className?: string;
}) {
const specs = (
<div className="space-y-1 border-t border-stone-200/60 pt-1 text-xs text-stone-600">
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>수용 인원: {room.capacity}</span>
</p>
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>침대 구성: {room.bedInfo}</span>
</p>
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>면적: {room.size}</span>
</p>
</div>
);
const highlight = (
<div className="flex items-start gap-2 rounded-xl border border-amber-200/70 bg-amber-50/80 p-3 text-xs text-amber-950">
<Sparkles className="mt-0.5 size-4 shrink-0 text-amber-600" />
<div className="break-keep leading-relaxed">
<strong className="font-bold">차별점: </strong>
<span>{room.difference}</span>
</div>
</div>
);
const cover = (
<div
className={cn(
'relative overflow-hidden bg-stone-100',
layout === 'row' ? 'aspect-4/3 sm:aspect-auto sm:h-full' : 'aspect-16/10',
)}
>
<img src={room.images[0].url} alt={room.images[0].alt} className="size-full object-cover" />
<Pill tone="dark" className="absolute left-3 top-3 rounded-full px-2.5 py-1 text-[11px] backdrop-blur-md">
{room.type}
</Pill>
{layout === 'card' && (
<span className="absolute bottom-2.5 right-2.5 rounded-lg bg-white/95 px-2.5 py-1 text-xs font-bold text-stone-900 shadow-2xs backdrop-blur-md">
{index + 1} / {total}
</span>
)}
</div>
);
const body = (
<div className="space-y-3 p-4 sm:p-5">
<div className="space-y-1">
<h3
className="serif-title text-base font-bold leading-snug text-stone-900 sm:text-lg"
style={colors ? {color: colors.text} : undefined}
>
{room.name}
</h3>
<div
className="font-mono text-sm font-extrabold text-stone-900 sm:text-base"
style={colors ? {color: colors.primary} : undefined}
>
{room.price}
</div>
</div>
{highlight}
{specs}
</div>
);
const action = (
<div className="p-4 pt-0 sm:p-5 sm:pt-0">
<CtaLink href={bookingUrl} variant="solid" size="sm" colors={colors} block>
<span>실시간 예약 신청</span>
<ExternalLink className="size-3.5" />
</CtaLink>
</div>
);
if (layout === 'row') {
return (
<div
className={cn(
'grid grid-cols-1 overflow-hidden rounded-2xl border border-stone-200/90 bg-stone-50/70 shadow-2xs sm:grid-cols-12',
className,
)}
>
<div className="sm:col-span-5">{cover}</div>
<div className="flex flex-col justify-between sm:col-span-7">
{body}
{action}
</div>
</div>
);
}
return (
<div
className={cn(
'flex flex-col justify-between overflow-hidden rounded-2xl border border-stone-200/90 bg-stone-50/70 shadow-2xs',
className,
)}
>
<div>
{cover}
{body}
</div>
{action}
</div>
);
}
@@ -0,0 +1,47 @@
/**
* 객실 · 가로 슬라이드 — 모바일에서 한 칸씩 스와이프, PC 에서는 2열.
* 객실이 2~4개일 때 가장 자연스럽다.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsCarousel(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약에 없다 — 시연용 세트로 자리를 메우지 않는다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle="자연을 오롯이 품은 객실 타입" colors={template.colors} />
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="space-y-4">
<div className="scrollbar-none flex snap-x snap-mandatory gap-4 overflow-x-auto px-1 pb-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:overflow-visible sm:pb-0">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
className="w-[85vw] max-w-[340px] shrink-0 snap-center sm:w-full"
colors={template.colors}
/>
))}
</div>
<div className="flex items-center justify-center gap-2 pt-1 text-[11px] text-stone-400 sm:hidden">
<span>← 좌우로 스와이프하여 다른 객실을 확인하세요 →</span>
</div>
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,45 @@
/**
* 객실 · 격자 — 전부 한눈에 늘어놓는다. 객실이 많고 비교해서 고르게 하고 싶을 때.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsGrid(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약에 없다 — 시연용 세트로 자리를 메우지 않는다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading
variant="centered"
eyebrow="ROOMS"
title={section.name}
subtitle="원하는 객실을 비교해 보세요"
colors={template.colors}
/>
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
colors={template.colors}
/>
))}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 객실 · 가로 목록 — 사진 왼쪽, 설명 오른쪽으로 한 줄씩.
* 객실마다 설명이 길 때 글을 넉넉히 읽힌다.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약(SectionRenderProps)에 없다 — 흘러올 창구가 생기기 전까지 빈다.
// 시연용 세트로 자리를 메우지 않는다: 남의 객실·요금이 사장님 사이트로 발행된다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading title={section.name} subtitle="객실별 구성과 차이를 자세히" colors={template.colors} />
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="space-y-4">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
layout="row"
colors={template.colors}
/>
))}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,51 @@
/**
* 이용 규정 · 카드 — 규정 하나에 칸 하나. 번호가 붙어 "빠뜨리지 말라"는 인상이 강하다.
* 노쇼·소음 클레임이 잦은 곳에 맞는다.
*/
import {ShieldCheck} from 'lucide-react';
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {ruleItems} from '../common';
export function RulesCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
// ★ 규정을 지어내지 않는다 — 확인된 fact 에서만 만든다.
const items = ruleItems(props.infoFields);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="HOUSE RULES"
title={section.name}
subtitle="예약 전 꼭 확인해 주세요"
trailing={<ShieldCheck className="size-5 text-stone-400" />}
/>
{items.length === 0 && (
<EmptyStateNotice>
확인된 이용 규정이 아직 없습니다 — 정보 탭에서 확인하면 여기에 나옵니다.
</EmptyStateNotice>
)}
<ol className="grid grid-cols-1 gap-2.5 sm:grid-cols-2">
{items.map((rule, idx) => (
<li
key={rule}
className="flex items-start gap-3 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs"
>
<span
className="flex size-6 shrink-0 items-center justify-center rounded-full text-[11px] font-bold text-white"
style={{backgroundColor: template.colors.primary}}
>
{idx + 1}
</span>
<span className="text-xs leading-relaxed text-stone-700">{rule}</span>
</li>
))}
</ol>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,58 @@
/**
* 이용 규정 · 목록 — 지켜야 할 것을 한 덩어리로 짧게. 가장 눈에 덜 띄는 형태.
*/
import {
SlateScriptRenderer,
type SlateElementNode,
type SlateTextNode,
} from '../../SlateScriptRenderer';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {EmptyStateNotice} from '../../primitives';
import {ruleItems} from '../common';
export function RulesList(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
// ★ 규정을 지어내지 않는다. 확인된 fact(체크인·체크아웃·취소규정·취사·반려동물…)에서만 만든다 —
// 예전에는 '체크인 16:00 / 체크아웃 11:00' 같은 가공의 규정이 모든 사업장에 똑같이 떴다.
const items = ruleItems(props.infoFields);
const script: (SlateElementNode | SlateTextNode)[] | undefined = undefined;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle="이용 안내 및 규정" />
{items.length === 0 ? (
<EmptyStateNotice>
확인된 이용 규정이 아직 없습니다 — 정보 탭에서 확인하면 여기에 나옵니다.
</EmptyStateNotice>
) : (
<div className="space-y-2 rounded-xl border border-stone-200/80 bg-stone-50/60 p-4 text-xs shadow-2xs">
<strong className="mb-2 block font-bold text-stone-900">투숙 및 이용 수칙</strong>
{items.map((rule) => (
<p key={rule} className="text-stone-600">
• {rule}
</p>
))}
</div>
)}
{script && (
<div className="space-y-3 rounded-xl border border-stone-200 bg-stone-50 p-4 sm:p-5">
<div className="flex items-center justify-between border-b border-stone-200 pb-2">
<span className="flex items-center gap-1.5 text-xs font-bold text-stone-800">
<span className="size-2 rounded-full bg-stone-900" />
호스트-게스트 실시간 문의 & 대화 가이드
</span>
<span className="rounded border border-stone-200 bg-white px-2 py-0.5 font-mono text-[11px] text-stone-400">
Slate editor_script
</span>
</div>
<SlateScriptRenderer nodes={script} primaryColor={template.colors.primary} />
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,28 @@
/**
* 공간 안내 · 목록 — 사진 없이 구역 이름과 설명만. 사진이 부실할 때 더 깔끔하다.
*/
import {ListCard, PlaceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function SpaceList(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, photos} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<ListCard>
{photos.map((photo) => (
<PlaceRow
key={photo.id}
name={photo.title}
meta={photo.category}
colors={template.colors}
/>
))}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,51 @@
/**
* 공간 안내 · 구역 카드 — 수집된 사진을 "어떤 자리인지"로 묶어 보여준다.
* 좌석/층 구성이 궁금한 카페·다이닝에 맞는다.
*/
import {PhotoTile, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function SpaceZones(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, photos, infoFields} = props;
const seats = infoFields.find((f) => f.id === 'seats');
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={
seats && !seats.requiresVerification ? (
<span className="rounded-lg border border-stone-200 bg-stone-50 px-2.5 py-1 text-[11px] font-medium text-stone-600">
{seats.value}
</span>
) : null
}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{photos.map((photo) => (
<div key={photo.id} className="space-y-2">
<PhotoTile
photo={{id: photo.id, url: photo.url, alt: photo.title}}
fit="landscape"
showMeta={false}
/>
<div className="space-y-0.5 px-0.5">
<span
className="block text-xs font-bold text-stone-900"
style={{color: template.colors.text}}
>
{photo.title}
</span>
<span className="block text-[11px] text-stone-500">{photo.category}</span>
</div>
</div>
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,27 @@
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {WeatherPanel} from '../local/WeatherPanel';
/** 에디터에서 순서·노출을 독립적으로 관리하는 날씨 섹션. */
export function WeatherSection({
section,
isSelected,
onSelect,
location,
weatherLocation,
template,
}: SectionRenderProps) {
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title="오늘의 날씨"
subtitle={`${location || '사업장 주변'}의 현재 기상 정보입니다.`}
colors={template.colors}
/>
<WeatherPanel location={location} weatherLocation={weatherLocation} />
</SectionBody>
</SectionFrame>
);
}