import { LayoutStyleProp } from '../../internal/utils/utilTypes'; import React, { ComponentProps } from 'react'; import { Typo } from '../../foundation'; import { PressableThrottled } from '../utils/PressableThrottled'; type Props = { variants: 'primary' | 'secondary' | 'white'; states: 'enabled' | 'disabled'; label: string; onPress: () => void; }; /** * ScreenHeader 컴포넌트에서 사용되는 단순한 텍스트 버튼 * * 피그마 시안의 Prop 구성을 따라 구현해두었습니다. */ export function TextButton(props: Props & LayoutStyleProp): React.JSX.Element { const isDisabled = props.states === 'disabled'; const color: ComponentProps['color'] = (() => { if (isDisabled) return 'text_quaternary'; switch (props.variants) { case 'primary': return 'text_purple'; case 'secondary': return 'text_secondary'; case 'white': return 'text_white'; } })(); return ( {props.label} ); }