/** * 오늘의 엽서 — 엽서 뒷면 더미. * * 앞면(사진)은 없다. 쓸 수 있는 사진이 없기도 하고, 이 아이템의 목적이 **손님이 자기 계정에 * 붙여넣는 것**이라 글이 놓이는 뒷면이 전부다. 우표 자리·소인·가운데 괘선이 그 형식을 만든다. */ import {useState} from 'react'; import {Check, Copy} from 'lucide-react'; import {Rail, SectionBody, SectionFrame} from '../../primitives'; import type {SectionRenderProps} from '../../types'; import {parseSectionData, type PostcardItem} from '@o2o/shared'; import { ITEM_ACCENT, ITEM_BODY, ITEM_BORDER, ITEM_CARD, ITEM_HEADING, ITEM_INK, ParseError, PasteHint, SourceLine, } from '../items/common'; import '../items/items.css'; function Postcard({item}: {item: PostcardItem}) { const [copied, setCopied] = useState(false); const text = [item.line, (item.hashtags ?? []).join(' ')].filter(Boolean).join(' '); const copy = (event: React.MouseEvent) => { event.stopPropagation(); navigator.clipboard.writeText(text).then( () => { setCopied(true); setTimeout(() => setCopied(false), 1600); }, () => { // 클립보드가 막힌 브라우저 — 직접 긁어 갈 수 있게 띄운다. window.prompt('아래 문장을 복사하세요', text); }, ); }; return (
{/* 가운데 괘선 — 엽서 뒷면을 반으로 가르는 그 선 */}

“{item.line}”

{item.hashtags && item.hashtags.length > 0 && (

{item.hashtags.join(' ')}

)}
郵票
10원
{item.postmark || item.place || '소인'}
); } export function PostcardStack(props: SectionRenderProps) { const {section, isSelected, onSelect} = props; const parsed = parseSectionData(section.type, section.data); return (

{parsed.title || section.name}

{(parsed.subtitle || section.description) && (

{parsed.subtitle || section.description}

)}
{parsed.error ? ( ) : parsed.items.length === 0 ? ( ) : (
{parsed.items.map((item, index) => ( ))}

[복사] 를 누르면 문장과 해시태그가 함께 복사됩니다 · 총 {parsed.items.length}장

)}
); }