import React from 'react'; import { Icon, SemanticColor, TypoIncludingEmoji } from '../../foundation'; import { Pressable, View } from 'react-native'; import { FilterChipProps } from './Chip'; export function FilterChip(props: FilterChipProps) { const { disabled, title, selected, onPress } = props; const backgroundColor = (() => { if (selected) { return disabled ? SemanticColor.bg_off_white : SemanticColor.bg_enabled; } return SemanticColor.bg_primary; })(); const borderColor = (() => { if (selected === true) { // 정의된 내용에는 border가 없지만 border를 넣지않으면 height가 줄어들기에 background color와 동일하게 설정 return backgroundColor; } return SemanticColor.border_secondary; })(); const color = (() => { if (disabled === true) return 'text_quaternary'; if (selected === true) return 'text_white'; return 'text_primary'; })(); function handlePress() { if (onPress) { onPress(title); } } return ( {title} ); }