refactor(i18n): 사용자 문구 참조를 중앙화
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { copy } from '@/shared/i18n';
|
||||
import { cn } from '@/shared/lib/cn';
|
||||
import {
|
||||
RECOVERY_30S_MODE_LABEL,
|
||||
@@ -26,11 +27,7 @@ interface SpaceTimerHudWidgetProps {
|
||||
onGoalCompleteRequest?: () => void;
|
||||
}
|
||||
|
||||
const HUD_ACTIONS = [
|
||||
{ id: 'start', label: '시작', icon: '▶' },
|
||||
{ id: 'pause', label: '일시정지', icon: '⏸' },
|
||||
{ id: 'reset', label: '리셋', icon: '↺' },
|
||||
] as const;
|
||||
const HUD_ACTIONS = copy.space.timerHud.actions;
|
||||
|
||||
export const SpaceTimerHudWidget = ({
|
||||
timerLabel,
|
||||
@@ -51,14 +48,14 @@ export const SpaceTimerHudWidget = ({
|
||||
onGoalCompleteRequest,
|
||||
}: SpaceTimerHudWidgetProps) => {
|
||||
const { isBreatheMode, triggerRestart } = useRestart30s();
|
||||
const normalizedGoal = goal.trim().length > 0 ? goal.trim() : '이번 한 조각을 설정해 주세요.';
|
||||
const normalizedGoal = goal.trim().length > 0 ? goal.trim() : copy.space.timerHud.goalFallback;
|
||||
const modeLabel = isBreatheMode
|
||||
? RECOVERY_30S_MODE_LABEL
|
||||
: !hasActiveSession
|
||||
? 'Ready'
|
||||
? copy.space.timerHud.readyMode
|
||||
: sessionPhase === 'break'
|
||||
? 'Break'
|
||||
: 'Focus';
|
||||
? copy.space.timerHud.breakMode
|
||||
: copy.space.timerHud.focusMode;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -105,7 +102,7 @@ export const SpaceTimerHudWidget = ({
|
||||
</div>
|
||||
<div className="mt-1.5 flex min-w-0 items-center gap-2">
|
||||
<p className={cn('min-w-0 truncate text-sm', isImmersionMode ? 'text-white/88' : 'text-white/86')}>
|
||||
<span className="text-white/62">이번 한 조각 · </span>
|
||||
<span className="text-white/62">{copy.space.timerHud.goalPrefix}</span>
|
||||
<span className="text-white/90">{normalizedGoal}</span>
|
||||
</p>
|
||||
<button
|
||||
@@ -113,7 +110,7 @@ export const SpaceTimerHudWidget = ({
|
||||
onClick={onGoalCompleteRequest}
|
||||
className="shrink-0 rounded-full border border-white/16 bg-white/[0.04] px-2 py-0.5 text-[10px] text-white/70 transition-colors hover:bg-white/[0.1] hover:text-white/86"
|
||||
>
|
||||
완료
|
||||
{copy.space.timerHud.completeButton}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user