대시보드 중간 커밋
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSessionStore } from "@/stores/session-store";
|
||||
import { SESSION_TIMEOUT_MS } from "@/features/auth/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
/**
|
||||
* 세션 만료 타이머 컴포넌트
|
||||
@@ -21,7 +22,12 @@ import { SESSION_TIMEOUT_MS } from "@/features/auth/constants";
|
||||
* @remarks 1초마다 리렌더링 발생
|
||||
* @see header.tsx - 로그인 상태일 때 헤더에 표시
|
||||
*/
|
||||
export function SessionTimer() {
|
||||
interface SessionTimerProps {
|
||||
/** 셰이더 배경 위에서 가독성을 높이는 투명 모드 */
|
||||
blendWithBackground?: boolean;
|
||||
}
|
||||
|
||||
export function SessionTimer({ blendWithBackground = false }: SessionTimerProps) {
|
||||
const lastActive = useSessionStore((state) => state.lastActive);
|
||||
|
||||
// [State] 남은 시간 (밀리초)
|
||||
@@ -54,11 +60,14 @@ export function SessionTimer() {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`text-sm font-medium tabular-nums px-3 py-1.5 rounded-md border bg-background/50 backdrop-blur-md hidden md:block transition-colors ${
|
||||
className={cn(
|
||||
"hidden rounded-full border px-3 py-1.5 text-sm font-medium tabular-nums backdrop-blur-md transition-colors md:block",
|
||||
isUrgent
|
||||
? "text-red-500 border-red-200 bg-red-50/50 dark:bg-red-900/20 dark:border-red-800"
|
||||
: "text-muted-foreground border-border/40"
|
||||
}`}
|
||||
? "border-red-200 bg-red-50/50 text-red-500 dark:border-red-800 dark:bg-red-900/20"
|
||||
: blendWithBackground
|
||||
? "border-white/30 bg-black/45 text-white shadow-sm shadow-black/40"
|
||||
: "border-border/40 bg-background/50 text-muted-foreground",
|
||||
)}
|
||||
>
|
||||
{/* ========== 라벨 ========== */}
|
||||
<span className="mr-2">세션 만료</span>
|
||||
|
||||
Reference in New Issue
Block a user