14 | {/* Step indicator */}
15 |
16 |
17 | Step {currentStep} of {totalSteps}
18 |
19 | {Math.round(progress)}%
20 |
21 |
22 | {/* Progress bar */}
23 |
29 |
30 | )
31 | }
32 |
--------------------------------------------------------------------------------
/web/src/stores/locale-store.ts:
--------------------------------------------------------------------------------
1 | import i18n from '@/i18n'
2 | import { ConfigStorage } from '@/lib/config-storage/config-storage'
3 |
4 | let storage: ConfigStorage | null = null
5 |
6 | /**
7 | * Initialize locale system with storage
8 | */
9 | export const initializeLocale = async (configStorage: ConfigStorage) => {
10 | storage = configStorage
11 | try {
12 | const storedLocale = await configStorage.get()
13 | if (storedLocale && storedLocale !== i18n.language) {
14 | await i18n.changeLanguage(storedLocale)
15 | }
16 | } catch {
17 | // i18next continues with default behavior
18 | }
19 | }
20 |
21 | /**
22 | * Set locale and save to storage
23 | */
24 | export const setLocale = async (locale: string) => {
25 | if (locale !== i18n.language) {
26 | await i18n.changeLanguage(locale)
27 | }
28 | await storage?.set(locale)
29 | }
30 |
31 | /**
32 | * Hook for components to use locale functionality
33 | */
34 | export const useLocale = () => {
35 | return {
36 | currentLanguage: i18n.language,
37 | setLocale,
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Adrian Shum
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/web/src/components/ui/slider.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | import * as SliderPrimitive from '@radix-ui/react-slider'
3 |
4 | import { cn } from '@/lib/utils'
5 |
6 | const Slider = React.forwardRef<
7 | React.ElementRef