diff --git a/client/src/components/horoscope-widget.tsx b/client/src/components/horoscope-widget.tsx
index a5546f9..4e7b442 100644
--- a/client/src/components/horoscope-widget.tsx
+++ b/client/src/components/horoscope-widget.tsx
@@ -8,6 +8,7 @@ interface AIHoroscope {
signIndex: number;
signName: string;
general: string;
+ imageUrl?: string | null;
}
function MiniStars({ count, max = 5 }: { count: number; max?: number }) {
@@ -44,6 +45,9 @@ export function HoroscopeWidget() {
// Prefer the real AI-generated horoscope for today; fall back to static text until loaded.
const aiForSign = aiHoroscopes.find((h) => h.signIndex === index);
const generalText = aiForSign?.general || getHoroscope(index).general;
+ const imageFor = (i: number) => aiHoroscopes.find((h) => h.signIndex === i)?.imageUrl || null;
+ const currentImage = imageFor(index);
+ const signPath = (i: number) => `/horoskop/${encodeURIComponent(SIGNS[i].name.toLowerCase())}`;
return (
setPaused(true)}
onMouseLeave={() => setPaused(false)}
- onClick={() => navigate("/horoskop")}
+ onClick={() => navigate(signPath(index))}
data-testid="widget-horoscope"
>
@@ -78,8 +82,18 @@ export function HoroscopeWidget() {
-
-
{sign.symbol}
+
+ {currentImage ? (
+

+ ) : (
+
{sign.symbol}
+ )}
{sign.name}
@@ -107,15 +121,30 @@ export function HoroscopeWidget() {
Mehr lesen
-
- {SIGNS.map((_, i) => (
-
diff --git a/client/src/pages/horoscope.tsx b/client/src/pages/horoscope.tsx
index 6f35cb1..336a546 100644
--- a/client/src/pages/horoscope.tsx
+++ b/client/src/pages/horoscope.tsx
@@ -337,7 +337,10 @@ export default function HoroscopePage() {
useEffect(() => {
if (params.sign) {
- const idx = SIGNS.findIndex((s) => s.name.toLowerCase() === params.sign?.toLowerCase());
+ let raw = params.sign;
+ try { raw = decodeURIComponent(params.sign); } catch { /* ostane surov */ }
+ const wanted = raw.toLowerCase();
+ const idx = SIGNS.findIndex((s) => s.name.toLowerCase() === wanted);
if (idx >= 0) setSelected(idx);
}
}, [params.sign]);