Skip to content

Commit dcaf479

Browse files
committed
feat(weather): improve layout of current weather box with enhanced description and playlist link
1 parent de17ca8 commit dcaf479

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

src/layouts/weather/components/current-box.component.tsx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,32 @@ export function CurrentWeatherBox({ weather }: CurrentWeatherBoxProps) {
4242
</div>
4343

4444
<div className="relative p-3 mt-4 rounded-lg bg-gray-100/80 dark:bg-neutral-800/50">
45-
{weather.ai?.description && (
46-
<div className="absolute -translate-y-1/2 left-3 top-1/2">
47-
<BsRobot size={20} className="text-purple-600 dark:text-purple-400" />
45+
<div className="flex items-center gap-3">
46+
<div className="flex-1">
47+
{weather.ai?.description && (
48+
<div className="absolute left-3 top-3">
49+
<BsRobot size={20} className="text-purple-600 dark:text-purple-400" />
50+
</div>
51+
)}
52+
<p
53+
className="pl-8 pr-2 text-sm leading-relaxed text-gray-700 dark:text-gray-300"
54+
dir="rtl"
55+
>
56+
{weather.ai?.description || weather.temperature.temp_description}
57+
</p>
58+
{weather.ai?.playlist && (
59+
<a
60+
href={weather.ai.playlist}
61+
target="_blank"
62+
rel="noopener noreferrer"
63+
className="inline-flex items-center gap-2 mt-2 text-xs text-purple-600 dark:text-purple-400 hover:underline"
64+
>
65+
<span>🎵</span>
66+
<span>پلی‌لیست پیشنهادی</span>
67+
</a>
68+
)}
4869
</div>
49-
)}
50-
<p
51-
className="pl-8 pr-2 text-sm leading-relaxed text-gray-700 dark:text-gray-300"
52-
dir="rtl"
53-
>
54-
{weather.ai?.description || weather.temperature.temp_description}
55-
</p>
70+
</div>
5671
</div>
5772
</div>
5873
)

0 commit comments

Comments
 (0)