import { useState } from 'react' import './Login.css' function Login({ onLogin }) { const [credentials, setCredentials] = useState({ username: '', password: '' }) const [error, setError] = useState('') const handleSubmit = (e) => { e.preventDefault() setError('') // Get credentials from runtime config (set via Helm values) const ADMIN_USERNAME = window.ENV?.VITE_ADMIN_USERNAME || import.meta.env.VITE_ADMIN_USERNAME || 'admin' const ADMIN_PASSWORD = window.ENV?.VITE_ADMIN_PASSWORD || import.meta.env.VITE_ADMIN_PASSWORD || 'wedding2025' if (credentials.username === ADMIN_USERNAME && credentials.password === ADMIN_PASSWORD) { localStorage.setItem('isAuthenticated', 'true') onLogin() } else { setError('שם משתמש או סיסמה שגויים') } } const handleChange = (e) => { const { name, value } = e.target setCredentials(prev => ({ ...prev, [name]: value })) } return (
הזן שם משתמש וסיסמה לגישה