'use client'; import { useEffect, useState, useCallback } from 'react'; import Link from 'next/link'; import type { Banner } from '@/lib/types'; import { resolveUploadUrl, cn } from '@/lib/utils'; const INTERVAL = 5000; export function BannerCarousel({ banners }: { banners: Banner[] }) { const [idx, setIdx] = useState(0); const total = banners.length; const next = useCallback(() => { setIdx((p) => (total === 0 ? 0 : (p + 1) % total)); }, [total]); useEffect(() => { if (total <= 1) return; const t = setInterval(next, INTERVAL); return () => clearInterval(t); }, [next, total]); if (total === 0) { return ; } return (
{banners.map((b, i) => (
{b.link ? ( ) : ( )}
))} {total > 1 && (
{banners.map((_, i) => (
)}
); } function BG({ image, title }: { image: string; title: string }) { return (

{title}

); } function HeroPlaceholder() { return (
物业管理系统 · 小程序 · SaaS

让物业管理
像发微信一样简单

懂物业,更懂“省”心。一站式物业管理平台,覆盖缴费、报修、公告、巡检全流程。

预约演示 了解产品
); }