'use client' import type { ReactNode } from 'react' import { css } from 'styled-system/css' import * as Dialog from '../Dialog' interface AddScenarioDialogProps { open: boolean onClose: () => void /** Render prop slot — consumer injects their scenario collection here. */ renderContent?: (props: { onClose: () => void }) => ReactNode /** Called when user clicks "Browse More Scenarios" in the footer */ onBrowseMore?: () => void /** Called when user clicks "Build Custom Scenario" in the footer */ onBuildCustom?: () => void } const dialogContentClass = css({ width: 'full', maxWidth: '560px', maxHeight: '80vh', display: 'flex', flexDirection: 'column', }) const dialogBodyClass = css({ flex: '1', overflowY: 'auto', py: '0', px: '6', }) const footerLinkClass = css({ display: 'inline-flex', alignItems: 'center', gap: '1', fontSize: 'sm', color: 'primary.solid.bg', fontWeight: 'medium', textDecoration: 'none', cursor: 'pointer', bg: 'transparent', border: 'none', p: '0', _hover: { textDecoration: 'underline' }, _focusVisible: { focusVisibleRing: 'outside' }, }) export function AddScenarioDialog({ open, onClose, renderContent, onBrowseMore, onBuildCustom, }: AddScenarioDialogProps) { return ( !isOpen && onClose()}> Add Scenario {/* Scrollable body — consumer owns this content */} {renderContent ? ( renderContent({ onClose }) ) : ( // Storybook placeholder
Scenario collection renders here
)}
) }