import React from 'react'; import { Box, Text } from '../index.js'; import { Spinner } from './Spinner.js'; type LoadingStateProps = { /** * The loading message to display next to the spinner. */ message: string; /** * Display the message in bold. * @default false */ bold?: boolean; /** * Display the message in dimmed color. * @default false */ dimColor?: boolean; /** * Optional subtitle displayed below the main message. */ subtitle?: string; }; /** * A spinner with loading message for async operations. * * @example * // Basic loading * * * @example * // Bold loading message * * * @example * // With subtitle * */ export function LoadingState({ message, bold = false, dimColor = false, subtitle, }: LoadingStateProps): React.ReactNode { return ( {' '} {message} {subtitle && {subtitle}} ); }