- V2 컴포넌트를 원본에 통합 후 V2 파일 삭제 (InspectionModal, BillDetail, ContractDocumentModal, LaborDetailClient, PricingDetailClient, QuoteRegistration) - store → stores 디렉토리 이동 및 favoritesStore 추가 - dashboard_type3~5 추가 및 기존 대시보드 차트/훅 분리 - Sidebar 리팩토링 및 HeaderFavoritesBar 추가 - DashboardSwitcher 컴포넌트 추가 - 백업 파일(.v1-backup) 및 불필요 코드 정리 - InspectionPreviewModal 레이아웃 개선 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
903 B
TypeScript
39 lines
903 B
TypeScript
import { create } from 'zustand';
|
|
import { persist } from 'zustand/middleware';
|
|
|
|
export type UserRole = 'SystemAdmin' | 'Manager' | 'User' | 'Guest';
|
|
|
|
interface DemoState {
|
|
userRole: UserRole;
|
|
companyName: string;
|
|
userName: string;
|
|
setUserRole: (role: UserRole) => void;
|
|
setCompanyName: (name: string) => void;
|
|
setUserName: (name: string) => void;
|
|
resetDemo: () => void;
|
|
}
|
|
|
|
const DEFAULT_STATE = {
|
|
userRole: 'Manager' as UserRole,
|
|
companyName: 'SAM 데모 회사',
|
|
userName: '홍길동',
|
|
};
|
|
|
|
export const useDemoStore = create<DemoState>()(
|
|
persist(
|
|
(set) => ({
|
|
...DEFAULT_STATE,
|
|
|
|
setUserRole: (role: UserRole) => set({ userRole: role }),
|
|
|
|
setCompanyName: (name: string) => set({ companyName: name }),
|
|
|
|
setUserName: (name: string) => set({ userName: name }),
|
|
|
|
resetDemo: () => set(DEFAULT_STATE),
|
|
}),
|
|
{
|
|
name: 'sam-demo',
|
|
}
|
|
)
|
|
); |