import React from 'react'; import { TouchableHighlight } from 'react-native'; import { Icon, IconName, SemanticColor } from '../../foundation'; import { FABContainer, FABCommonProps } from './FABContainer'; import { useThrottledPressHandler } from '../../internal/utils/useThrottledPressHandler'; type Props = FABCommonProps & { onPress: () => void; icon: IconName; size?: 'large' | 'medium' }; /** * ## Floating Action Button - Only Icon 컴포넌트 * * ## Props * * ### `size` * - 기본값 `'large'` * - 버튼 크기 (large: 56x56, medium: 48x48) * * ### `icon` (필수) * - 아이콘 이름 * * ### `onPress` (필수) * - 버튼 press 핸들러 * * ### `layoutStyle` * - 컴포넌트를 배치하는데 필요한 ViewStyle 모음 * * ### `throttle` * - 버튼 throttle 옵션 (사용 방법은 타입정의 문서 참고) * * * ## 사용 예시 * @example * ```tsx * // 다른 뷰로 감싸 사용하는 예시 * * * * * // 단독으로 사용하는 예시 * * ``` */ export function FloatingActionButtonOnlyIcon({ size = 'large', ...props }: Props): React.JSX.Element { const throttledPressHandler = useThrottledPressHandler(props.onPress, props.throttle); return ( ); }