import { useState } from 'react'; const HoroscopeGenerator = () => { const [dob, setDob] = useState(''); const [showHoroscope, setShowHoroscope] = useState(false); const rasiPositions = [ { id: 1, label: 'Rasi', position: 'top-left' }, { id: 2, label: 'Rasi', position: 'top-center-left' }, { id: 3, label: 'Rasi', position: 'top-center-right' }, { id: 4, label: 'Rasi', position: 'top-right' }, { id: 5, label: 'Rasi', position: 'middle-left' }, { id: 6, label: 'Rasi', position: 'middle-right' }, { id: 7, label: 'Rasi', position: 'bottom-left' }, { id: 8, label: 'Rasi', position: 'bottom-center-left' }, { id: 9, label: 'Rasi', position: 'bottom-center-right' }, { id: 10, label: 'Rasi', position: 'bottom-right' }, ]; const navamsaPositions = [ { id: 1, label: 'Navamsam', position: 'top-left' }, { id: 2, label: 'Navamsam', position: 'top-center-left' }, { id: 3, label: 'Navamsam', position: 'top-center-right' }, { id: 4, label: 'Navamsam', position: 'top-right' }, { id: 5, label: 'Navamsam', position: 'middle-left' }, { id: 6, label: 'Navamsam', position: 'middle-right' }, { id: 7, label: 'Navamsam', position: 'bottom-left' }, { id: 8, label: 'Navamsam', position: 'bottom-center-left' }, { id: 9, label: 'Navamsam', position: 'bottom-center-right' }, { id: 10, label: 'Navamsam', position: 'bottom-right' }, ]; const zodiacSigns = [ { name: 'Aries', emoji: '♈' }, { name: 'Taurus', emoji: '♉' }, { name: 'Gemini', emoji: '♊' }, { name: 'Cancer', emoji: '♋' }, { name: 'Leo', emoji: '♌' }, { name: 'Virgo', emoji: '♍' }, { name: 'Libra', emoji: '♎' }, { name: 'Scorpio', emoji: '♏' }, { name: 'Sagittarius', emoji: '♐' }, { name: 'Capricorn', emoji: '♑' }, { name: 'Aquarius', emoji: '♒' }, { name: 'Pisces', emoji: '♓' } ]; const getZodiacSign = (date) => { const month = date.getMonth() + 1; const day = date.getDate(); if ((month === 3 && day >= 21) || (month === 4 && day <= 19)) return 0; if ((month === 4 && day >= 20) || (month === 5 && day <= 20)) return 1; if ((month === 5 && day >= 21) || (month === 6 && day <= 20)) return 2; if ((month === 6 && day >= 21) || (month === 7 && day <= 22)) return 3; if ((month === 7 && day >= 23) || (month === 8 && day <= 22)) return 4; if ((month === 8 && day >= 23) || (month === 9 && day <= 22)) return 5; if ((month === 9 && day >= 23) || (month === 10 && day <= 22)) return 6; if ((month === 10 && day >= 23) || (month === 11 && day <= 21)) return 7; if ((month === 11 && day >= 22) || (month === 12 && day <= 21)) return 8; if ((month === 12 && day >= 22) || (month === 1 && day <= 19)) return 9; if ((month === 1 && day >= 20) || (month === 2 && day <= 18)) return 10; return 11; }; const handleGenerate = () => { if (dob) { setShowHoroscope(true); } }; const userZodiacIndex = dob ? getZodiacSign(new Date(dob)) : -1; const ChartBox = ({ label, onClick }) => (
{label}
); return (
{/* Header */}

Astrology / Horoscope

{/* Date Input Section */}
setDob(e.target.value)} className="w-full px-4 py-3 bg-gray-100 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-800" />
{/* Add Rasi Section */}

Add Rasi

{/* Rasi Chart Grid */}
{/* Top Row - 4 boxes */} {}} /> {}} /> {}} /> {}} /> {/* Middle Row - Left box, Center image, Right box */} {}} />
Horoscope Chart
{}} /> {/* Middle Row 2 - Left box continues, Right box continues */} {}} /> {}} /> {/* Bottom Row - 4 boxes */} {}} /> {}} /> {}} /> {}} />
{/* Add Navamsam Section */}

Add Navamsam

{/* Navamsam Chart Grid */}
{/* Top Row - 4 boxes */} {}} /> {}} /> {}} /> {}} /> {/* Middle Row - Left box, Center image, Right box */} {}} />
Navamsam Chart
{}} /> {/* Middle Row 2 */} {}} /> {}} /> {/* Bottom Row - 4 boxes */} {}} /> {}} /> {}} /> {}} />
{/* Working Hours Button */}
{/* Result Display */} {showHoroscope && userZodiacIndex >= 0 && (
{zodiacSigns[userZodiacIndex].emoji}
Your Zodiac Sign: {zodiacSigns[userZodiacIndex].name}
)}
); }; export default HoroscopeGenerator;