"use client";
import { BannerRep } from "@/api/home";
import Box from "@/components/Box";
import { Swiper } from "antd-mobile";
import { FC } from "react";
interface Props {
    notices: BannerRep[];
}
const HomeNoticeBar: FC<Props> = (props) => {
    const { notices } = props;
    return (
        <div className={"my-[0.0694rem] flex items-center"}>
            <div className={"iconfont icon-laba mr-[0.06rem] text-[yellow]"}></div>
            <Swiper
                direction="vertical"
                className={"text-[yellow]"}
                indicator={() => null}
                style={{ "--height": "0.2083rem" }}
                loop
                autoplay
            >
                {notices.map((notice, index) => (
                    <Swiper.Item key={index}>
                        <Box none action={notice.action_type} actionData={notice.action_params}>
                            <div dangerouslySetInnerHTML={{ __html: notice.content! }}></div>
                        </Box>
                    </Swiper.Item>
                ))}
            </Swiper>
        </div>
    );
};
export default HomeNoticeBar;
