import { estimateReplicateSeedance20Usd, isSeedanceSegmentModel, REPLICATE_SEEDANCE_20_URL, type SegmentVideoModel, } from '@/api'; const money = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 2 }); type Props = { videoModel: SegmentVideoModel; resolution: '480p' | '720p' | '1080p'; clipCount: number; totalOutputSeconds: number; /** When set, append one short caveat (e.g. direct vs segmented). */ flow?: 'direct' | 'planned'; }; export function SeedanceReplicateCostNote({ videoModel, resolution, clipCount, totalOutputSeconds, flow, }: Props) { if (!isSeedanceSegmentModel(videoModel)) return null; const { usdPerSecond, estimatedUsd } = estimateReplicateSeedance20Usd({ resolution, totalOutputSeconds, }); const fast1080 = videoModel === 'seedance-2-fast' && resolution === '1080p' ? ' · Fast may omit 1080p' : ''; const foot = flow === 'direct' ? 'Replicate image-in tiers; KIE may differ. Segmented fallback = more clips.' : 'Replicate image-in tiers; KIE may differ.'; return (

~{money.format(estimatedUsd)} · {clipCount} clip{clipCount === 1 ? '' : 's'} · {totalOutputSeconds}s @ {resolution} · {money.format(usdPerSecond)}/s · Replicate {fast1080 ? {fast1080} : null}

{foot}

); }