feat: API 프록시 추가 및 품목기준관리 기능 개선
- HttpOnly 쿠키 기반 API 프록시 라우트 추가 (/api/proxy/[...path]) - 품목기준관리 컴포넌트 개선 (섹션, 필드, 다이얼로그) - ItemMasterContext API 연동 강화 - mock-data 제거 및 실제 API 연동 - 문서 명명규칙 정리 ([TYPE-DATE] 형식) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,13 +3,19 @@ import { useState, useEffect } from 'react';
|
||||
/**
|
||||
* 현재 시간을 반환하는 최적화된 훅
|
||||
* 1분마다 자동 업데이트
|
||||
*
|
||||
* ✅ SSR-safe: useEffect를 사용하여 클라이언트에서만 시간 초기화
|
||||
* 이를 통해 서버/클라이언트 하이드레이션 불일치 방지
|
||||
*/
|
||||
export function useCurrentTime(updateInterval = 60000) {
|
||||
const [currentTime, setCurrentTime] = useState(() =>
|
||||
new Date().toLocaleString('ko-KR')
|
||||
);
|
||||
// ✅ 초기값을 빈 문자열로 설정 (서버 렌더링 시 안전)
|
||||
const [currentTime, setCurrentTime] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
// ✅ 클라이언트 마운트 시 즉시 현재 시간 설정
|
||||
setCurrentTime(new Date().toLocaleString('ko-KR'));
|
||||
|
||||
// 주기적 업데이트
|
||||
const interval = setInterval(() => {
|
||||
setCurrentTime(new Date().toLocaleString('ko-KR'));
|
||||
}, updateInterval);
|
||||
|
||||
Reference in New Issue
Block a user