1
1
'use client'
2
2
3
3
import React , { useEffect , useMemo , useState } from 'react'
4
+ import { FlaskConical , HelpCircle } from 'lucide-react'
4
5
import { useAlchemyData } from './hooks/useAlchemyData'
5
6
import { useQueryState , type QueryState } from './hooks/useQueryState'
6
7
import { usePotionFilters } from './hooks/usePotionFilters'
@@ -97,13 +98,32 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
97
98
98
99
return (
99
100
< div className = { `min-h-screen bg-background text-foreground ${ className || '' } ` } >
100
- < header className = "pt-4 " >
101
- < div className = "container mx-auto" >
101
+ < header className = "py-3 " >
102
+ < div className = "container mx-auto px-4 " >
102
103
< div className = "flex items-center justify-between" >
103
- < h1 className = "text-3xl font-bold" > KCD2 Alchemy Scholar</ h1 >
104
- { /* Save view toggle in header */ }
104
+ < div className = "flex items-center gap-3" >
105
+ < div className = "flex items-center justify-center w-8 h-8 rounded-lg bg-[var(--accent-light)] text-[var(--accent)]" >
106
+ < FlaskConical className = "w-5 h-5" />
107
+ </ div >
108
+ < div >
109
+ < h1 className = "text-2xl font-bold text-[var(--text-primary)]" > KCD2 Alchemy Scholar</ h1 >
110
+ < p className = "text-[var(--text-tertiary)] text-xs" >
111
+ Search and filter Kingdom Come: Deliverance 2 alchemy recipes • Recipes by{ ' ' }
112
+ < a
113
+ href = "https://github.com/Omricon/Henrys-Moste-Potente-Potions"
114
+ className = "text-[var(--link)] hover:text-[var(--link-hover)] underline"
115
+ target = "_blank"
116
+ rel = "noopener noreferrer"
117
+ >
118
+ Omricon
119
+ </ a >
120
+ </ p >
121
+ </ div >
122
+ </ div >
123
+
124
+ { /* Compact save view toggle */ }
105
125
< div className = "flex items-center gap-2 text-xs" >
106
- < span className = "text-[var(--muted-2)] " > Save view</ span >
126
+ < span className = "text-[var(--text-secondary)] font-medium " > Save view</ span >
107
127
< button
108
128
type = "button"
109
129
role = "switch"
@@ -114,32 +134,31 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
114
134
setSaveEnabled ( next )
115
135
showToast ( next ? 'Saving filters enabled.' : 'Saved filters cleared and disabled.' , next ? 'success' : 'info' )
116
136
} }
117
- className = { `relative inline-flex h-5 w-9 items-center rounded-full border-2 bg-[var(--chip-bg)] focus-visible:ring-2 focus-visible:ring-[var(--link)] transition-colors ${ saveEnabled ? 'border-[var(--link)]' : 'border-[var(--border)]' } ` }
137
+ className = { `relative inline-flex h-4 w-8 items-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] ${
138
+ saveEnabled ? 'bg-[var(--accent)]' : 'bg-[var(--surface-2)]'
139
+ } `}
118
140
title = "When enabled, your current search, ingredient filters, and alchemy skill are saved and restored here."
119
141
>
120
142
< span
121
- className = "inline-block h-4 w-4 transform rounded-full bg-[var(--card)] border border-[var(--muted)] transition-transform"
122
- style = { { transform : saveEnabled ? 'translateX(16px)' : 'translateX(1px)' } }
143
+ className = { `inline-block h-3 w-3 transform rounded-full transition-transform bg-white shadow-sm ${
144
+ saveEnabled ? 'translate-x-4' : 'translate-x-0.5'
145
+ } `}
123
146
/>
124
147
</ button >
125
148
< button
126
149
type = "button"
127
- className = "inline- flex items-center justify-center w-4 h-4 rounded-full border border -[var(--border )] text-[var(--muted-2 )] hover:text -[var(--foreground )] bg -[var(--surface-hover)] "
150
+ className = "flex items-center justify-center w-4 h-4 rounded-full bg -[var(--surface-2 )] text-[var(--text-tertiary )] hover:bg -[var(--surface-3 )] hover:text -[var(--text-secondary)] transition-colors "
128
151
aria-label = "Help: Save view"
129
152
title = "Saves your current search, ingredient filters, and alchemy level to this browser so they persist across visits."
130
153
>
131
- ?
154
+ < HelpCircle className = "w-3 h-3" />
132
155
</ button >
133
156
</ div >
134
157
</ div >
135
- < p className = "text-[var(--muted-2)] mt-1" >
136
- Browse and filter Kingdom Come: Deliverance 2 alchemy recipes.< br />
137
- </ p >
138
- < p className = "text-[var(--muted-2)] text-right italic" > * Recipes by < a href = "https://github.com/Omricon/Henrys-Moste-Potente-Potions" className = "underline" target = "_blank" rel = "noopener noreferrer" > Omricon</ a > .</ p >
139
158
</ div >
140
159
</ header >
141
160
142
- < main className = "container mx-auto p-4 space-y-4 " >
161
+ < main className = "container mx-auto p-4 space-y-3 " >
143
162
< section className = "flex flex-col gap-3" >
144
163
< SearchBar value = { queryState . q } onChange = { ( q ) => setStateAndPersist ( { q } ) } />
145
164
< FiltersPanel
@@ -183,4 +202,3 @@ export default function Kcd2Alchemy({ className }: Kcd2AlchemyProps) {
183
202
}
184
203
185
204
export { Kcd2Alchemy }
186
-
0 commit comments