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