import type { Ref } from 'react' import { createPortal } from 'react-dom' import { cx } from '../lib/utils' import type { TopIndex } from '../api/client/types.gen' import { MEDALS, type TimeKind } from './lib' import { Ic } from './ui' /** 공유 이미지 전용 틀. 화면 밖에 그려 두고 보내기 때 이것만 찍는다 (화면의 버튼은 이미지에서 빠지므로 글자만으로 만든다) */ function Offscreen({ children }: { children: React.ReactNode }) { return createPortal(
, document.body, ) } export type DayShare = { kind: TimeKind label: string now: boolean icon: string temp: string score?: number | null gak?: { name: string; icon: string } | null } function DayLabel({ d, size }: { d: DayShare; size: string }) { return ( {d.label} {d.now && 지금} ) } /** 히어로 공유: 아침·낮·저녁·밤 네 줄. 줄마다 그 시간대 하늘에 날씨·기온, 날씨 점수, 그 시간 1등 각. 로고·지역·날짜는 공유 틀이 그린다 */ export function DayShareCard({ days, ref }: { days: DayShare[]; ref: Ref{title}