Implemented comprehensive Romanian Biblical Guide web app: - Next.js 15 with App Router and TypeScript - Material UI 7.3.2 for modern, responsive design - PostgreSQL database with Prisma ORM - Complete Bible reader with book/chapter navigation - AI-powered biblical chat with Romanian responses - Prayer wall for community prayer requests - Advanced Bible search with filters and highlighting - Sample Bible data imported from API.Bible - All API endpoints created and working - Professional Material UI components throughout - Responsive layout with navigation and theme 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { create } from 'zustand'
|
|
import { persist } from 'zustand/middleware'
|
|
import { User, Bookmark } from '@/types'
|
|
|
|
interface AppState {
|
|
user: User | null
|
|
theme: 'light' | 'dark'
|
|
fontSize: 'small' | 'medium' | 'large'
|
|
currentBook: number
|
|
currentChapter: number
|
|
bookmarks: Bookmark[]
|
|
setUser: (user: User | null) => void
|
|
setTheme: (theme: 'light' | 'dark') => void
|
|
setFontSize: (size: 'small' | 'medium' | 'large') => void
|
|
setCurrentBook: (book: number) => void
|
|
setCurrentChapter: (chapter: number) => void
|
|
addBookmark: (bookmark: Bookmark) => void
|
|
removeBookmark: (bookmarkId: string) => void
|
|
}
|
|
|
|
export const useStore = create<AppState>()(
|
|
persist(
|
|
(set) => ({
|
|
user: null,
|
|
theme: 'light',
|
|
fontSize: 'medium',
|
|
currentBook: 1,
|
|
currentChapter: 1,
|
|
bookmarks: [],
|
|
setUser: (user) => set({ user }),
|
|
setTheme: (theme) => set({ theme }),
|
|
setFontSize: (fontSize) => set({ fontSize }),
|
|
setCurrentBook: (currentBook) => set({ currentBook }),
|
|
setCurrentChapter: (currentChapter) => set({ currentChapter }),
|
|
addBookmark: (bookmark) => set((state) => ({
|
|
bookmarks: [...state.bookmarks, bookmark]
|
|
})),
|
|
removeBookmark: (bookmarkId) => set((state) => ({
|
|
bookmarks: state.bookmarks.filter(b => b.id !== bookmarkId)
|
|
})),
|
|
}),
|
|
{
|
|
name: 'bible-chat-storage',
|
|
}
|
|
)
|
|
) |