Refactor project structure and dependencies; rename package to azaion-ui, update version to 0.0.1, and remove unused files. Introduce new routing and authentication features in App component.

This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-25 03:10:15 +02:00
parent e407308284
commit 157a33096a
112 changed files with 6530 additions and 17843 deletions
+12
View File
@@ -0,0 +1,12 @@
import { useState, useEffect } from 'react'
export function useDebounce<T>(value: T, delay: number): T {
const [debounced, setDebounced] = useState(value)
useEffect(() => {
const timer = setTimeout(() => setDebounced(value), delay)
return () => clearTimeout(timer)
}, [value, delay])
return debounced
}
+32
View File
@@ -0,0 +1,32 @@
import { useState, useCallback, useRef, useEffect } from 'react'
export function useResizablePanel(initialWidth: number, min = 100, max = 600) {
const [width, setWidth] = useState(initialWidth)
const dragging = useRef(false)
const startX = useRef(0)
const startWidth = useRef(0)
const onMouseDown = useCallback((e: React.MouseEvent) => {
dragging.current = true
startX.current = e.clientX
startWidth.current = width
e.preventDefault()
}, [width])
useEffect(() => {
const onMouseMove = (e: MouseEvent) => {
if (!dragging.current) return
const delta = e.clientX - startX.current
setWidth(Math.min(max, Math.max(min, startWidth.current + delta)))
}
const onMouseUp = () => { dragging.current = false }
window.addEventListener('mousemove', onMouseMove)
window.addEventListener('mouseup', onMouseUp)
return () => {
window.removeEventListener('mousemove', onMouseMove)
window.removeEventListener('mouseup', onMouseUp)
}
}, [min, max])
return { width, onMouseDown, setWidth }
}