"use client"; /** * VaniOfTheDayCTA — a home-page card suggesting the day's "Vāṇī of the Day": * one prose chapter, verse, or lecture chosen by the backend (the same for * everyone that day, never repeating within 90 days). Tapping it opens the * item. Renders nothing until/unless the pick loads, so it never leaves an * empty frame. Styled to match SadhnaStreakCTA. */ import { useEffect, useState } from "react"; import Link from "next/link"; import { ChevronRight, Quote } from "lucide-react"; import { getVaniOfTheDay, type Vani } from "@/lib/vani"; export function VaniOfTheDayCTA() { const [vani, setVani] = useState(null); useEffect(() => { let cancelled = false; getVaniOfTheDay() .then((v) => { if (!cancelled) setVani(v); }) .catch(() => { /* card simply doesn't render */ }); return () => { cancelled = true; }; }, []); if (!vani) return null; return (

Vāṇī of the day {vani.label}

{vani.title}

{vani.subtitle ? (

{vani.subtitle}

) : null}
); }