-
- {images.map((image, index) => (
-
-
-
-
-
-
-
- ))}
-
+ {images.length > 0 ? (
+
+ {images.map((image, index) => (
+
+
+
+
+
+
+
+ ))}
+
+ ) : (
+
+ No images available. Please add one.
+
+ )}
-
-
@@ -90,5 +124,4 @@ const Hero = () => {
);
};
-
-export default Hero;
\ No newline at end of file
+export default Hero;
diff --git a/src/components/LoginForm.jsx b/src/components/LoginForm.jsx
index 4aef1a5..fbeddc9 100644
--- a/src/components/LoginForm.jsx
+++ b/src/components/LoginForm.jsx
@@ -8,8 +8,13 @@ const LoginForm = () => {
const navigate = useNavigate();
const handleLogin = () => {
- const validEmail = process.env.VITE_USERNAME;
- const validPassword = process.env.VITE_PASSWORD;
+ const validEmail = import.meta.env.VITE_USERNAME;
+ const validPassword = import.meta.env.VITE_PASSWORD;
+
+ if (!username || !password) {
+ toast.error("Please fill in your credentials.");
+ return;
+ }
if (username === validEmail && password === validPassword) {
toast.success("Login successful!");