import classNames from "classnames"; import { useEffect } from "react"; import { useInView } from "react-intersection-observer"; import { FormattedMessage } from "react-intl"; interface ShowMoreProps { text?: string; className?: string; onClick: () => void; } const ShowMore = ({ text, onClick, className = "" }: ShowMoreProps) => { return (
); }; export default ShowMore; export function AutoShowMore({ text, onClick, className }: ShowMoreProps) { const { ref, inView } = useInView({ rootMargin: "2000px" }); useEffect(() => { if (inView) { onClick(); } }, [inView]); return (
); }