refactor(toast): HUD 상태 라인 피드백 통합 및 우선순위 큐 적용
This commit is contained in:
@@ -12,8 +12,13 @@ interface SpaceTimerHudWidgetProps {
|
||||
goal: string;
|
||||
className?: string;
|
||||
isImmersionMode?: boolean;
|
||||
statusLine?: {
|
||||
message: string;
|
||||
actionLabel?: string;
|
||||
} | null;
|
||||
onPlaybackStateChange?: (state: 'running' | 'paused') => void;
|
||||
onGoalCompleteRequest?: () => void;
|
||||
onStatusAction?: () => void;
|
||||
}
|
||||
|
||||
const HUD_ACTIONS = [
|
||||
@@ -27,8 +32,10 @@ export const SpaceTimerHudWidget = ({
|
||||
goal,
|
||||
className,
|
||||
isImmersionMode = false,
|
||||
statusLine = null,
|
||||
onPlaybackStateChange,
|
||||
onGoalCompleteRequest,
|
||||
onStatusAction,
|
||||
}: SpaceTimerHudWidgetProps) => {
|
||||
const { isBreatheMode, hintMessage, triggerRestart } = useRestart30s();
|
||||
const normalizedGoal = goal.trim().length > 0 ? goal.trim() : '이번 한 조각을 설정해 주세요.';
|
||||
@@ -89,7 +96,22 @@ export const SpaceTimerHudWidget = ({
|
||||
완료
|
||||
</button>
|
||||
</div>
|
||||
{hintMessage ? (
|
||||
{statusLine ? (
|
||||
<div className="mt-1 flex min-w-0 items-center gap-2">
|
||||
<p className={cn('min-w-0 truncate text-[11px]', isImmersionMode ? 'text-white/68' : 'text-white/66')}>
|
||||
{statusLine.message}
|
||||
</p>
|
||||
{statusLine.actionLabel ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onStatusAction}
|
||||
className="shrink-0 text-[11px] font-medium text-white/76 underline-offset-2 transition-colors hover:text-white/92 hover:underline"
|
||||
>
|
||||
{statusLine.actionLabel}
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
) : hintMessage ? (
|
||||
<p className={cn('mt-1 truncate text-[10px]', isImmersionMode ? 'text-white/52' : 'text-white/52')}>
|
||||
{hintMessage}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user