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
+47
View File
@@ -0,0 +1,47 @@
import { useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'
interface Props {
open: boolean
title: string
message?: string
onConfirm: () => void
onCancel: () => void
}
export default function ConfirmDialog({ open, title, message, onConfirm, onCancel }: Props) {
const { t } = useTranslation()
const cancelRef = useRef<HTMLButtonElement>(null)
useEffect(() => {
if (open) cancelRef.current?.focus()
}, [open])
useEffect(() => {
if (!open) return
const handler = (e: KeyboardEvent) => {
if (e.key === 'Escape') onCancel()
}
window.addEventListener('keydown', handler)
return () => window.removeEventListener('keydown', handler)
}, [open, onCancel])
if (!open) return null
return (
<div className="fixed inset-0 bg-black/60 flex items-center justify-center z-[100]">
<div className="bg-az-panel border border-az-border rounded-lg p-4 w-80 shadow-xl">
<h3 className="text-white font-semibold mb-2">{title}</h3>
{message && <p className="text-az-text text-sm mb-4">{message}</p>}
<div className="flex justify-end gap-2">
<button ref={cancelRef} onClick={onCancel} className="px-3 py-1 text-sm border border-az-border rounded hover:bg-az-bg text-az-text">
{t('common.cancel')}
</button>
<button onClick={onConfirm} className="px-3 py-1 text-sm bg-az-red rounded hover:bg-red-600 text-white">
{t('common.confirm')}
</button>
</div>
</div>
</div>
)
}