import MapUtl from "@/components/map/mapUtil";
import { useEffect, useState } from "react";

const Weather = () => {
  const [wechaer, setWechaer] = useState<any>();
  useEffect(() => {
    setTimeout(() => {
      MapUtl.wecherInfo?.getLive("双流区", (err, data) => {
        setWechaer(data);
      });
    }, 2000);
  }, []);
  return (
    <div
      style={{
        flex: "1",
        color: "#fff",
        fontSize: "13px",
        padding:"10px"
      }}
    >
      <div
        style={{
          fontSize: ".8rem",
          display: "flex",
          justifyContent: "space-between",
          alignItems: "center",
        }}
      >
        <span>天气:{wechaer?.weather}</span>
        <span>风向:{wechaer?.windDirection}</span>
      </div>
      <div
        style={{
          fontSize: ".8rem",
          display: "flex",
          justifyContent: "space-between",
          alignItems: "center",
        }}
      >
        <span>风级:{wechaer?.windPower}</span>
        <span>湿度:{wechaer?.humidity}</span>
      </div>
    </div>
  );
};

export default Weather;
