"use client";
import { useState } from "react";
import { motion, AnimatePresence } from "framer-motion";
import WeatherCard from "./WeatherCard";
import SavingsCard from "./SavingsCard";
interface Props {
weather: any;
savings: any[];
}
export default function WeatherSavingsCard({ weather, savings }: Props) {
const [view, setView] = useState<"weather" | "savings">("weather");
return (
{/* Toggle pills */}
{[
{ id: "weather", label: "🌤 Погода" },
{ id: "savings", label: "💰 Цели" },
].map((tab) => (
setView(tab.id as "weather" | "savings")}
className="flex-1 py-1.5 rounded-xl text-xs font-semibold relative"
style={{
color: view === tab.id ? "var(--text-primary)" : "var(--text-secondary)",
}}
whileTap={{ scale: 0.95 }}
>
{view === tab.id && (
)}
{tab.label}
))}
{/* Content */}
{view === "weather" ? (
) : (
)}
);
}