/* * 언어 선택기 — ko/en/zh/ja 세그먼트. more/profile 등 설정 영역에서 재사용. * 현재 언어 강조 + 선택 시 지속(AsyncStorage `kintex_lang`) + 전 화면 즉시 갱신(react-i18next). */ import React from 'react'; import { useTranslation } from 'react-i18next'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { useLanguage } from '../context/LanguageContext'; import type { Lang } from '../lib/i18n/types'; import { colors, radius, spacing, touch, type } from '../theme'; import { Card } from './Card'; export function LanguageSelector() { const { t } = useTranslation(); const { lang, supported, setLanguage } = useLanguage(); return ( {t('lang.title')} {t('lang.subtitle')} {supported.map((code: Lang) => { const on = lang === code; return ( { if (!on) void setLanguage(code); }} > {t(`lang.${code}` as const)} ); })} ); } const styles = StyleSheet.create({ title: { color: colors.neutral900, fontSize: type.h3.fontSize, fontWeight: '700' }, subtitle: { color: colors.neutral500, fontSize: type.caption.fontSize, marginTop: 4, marginBottom: spacing.sm }, segment: { flexDirection: 'row', backgroundColor: colors.neutral050, borderWidth: 1, borderColor: colors.neutral200, borderRadius: radius.md, padding: 4, gap: 4, }, segBtn: { flex: 1, minHeight: touch.min, alignItems: 'center', justifyContent: 'center', borderRadius: radius.sm, }, segBtnOn: { backgroundColor: colors.primary600 }, segText: { fontSize: type.caption.fontSize, fontWeight: '700', color: colors.neutral700 }, segTextOn: { color: colors.white }, });