import React from 'react'; import { StyleProp, View, ViewStyle } from 'react-native'; import { Typo } from '../../foundation'; import { Spin } from './Spin'; type Props = { text?: string; style?: StyleProp; }; /** * # [Component] SpinWithText * * SpinWithText를 감싸는 부모 컴포넌트는 flex: 1을 가지고 있어야 합니다. * ScrollView 내부에 SpinWithText를 사용할 경우, contentContainerStyle에 flexGrow: 1을 설정해야 합니다. * * ## Props * * ### `text` * - (optional) 스피너 아래에 표시될 텍스트 * * ### `style` * - (optional) View 스타일 * - spin의 수직 위치 조정을 위해 paddingTop을 사용할 수 있습니다. 단, justifyContent: undefined로 설정해야 합니다. * * @example * ```tsx * * ``` * */ export function SpinWithText(props: Props): React.JSX.Element { return ( {props.text && ( {props.text} )} ); }