|
|
@ -1,6 +1,6 @@
|
|
|
|
'use client';
|
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
import { useMemo, useState } from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
import ImageWithBasePath from '@/components/ImageWithBasePath';
|
|
|
|
import ImageWithBasePath from '@/components/ImageWithBasePath';
|
|
|
|
|
|
|
|
|
|
|
@ -18,31 +18,39 @@ const Icon = ({ name }: { name: string }) => (
|
|
|
|
export default function ArticalWrap(props: { content?: any }) {
|
|
|
|
export default function ArticalWrap(props: { content?: any }) {
|
|
|
|
const { content } = props;
|
|
|
|
const { content } = props;
|
|
|
|
const [isFold, setIsFold] = useState(true);
|
|
|
|
const [isFold, setIsFold] = useState(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showFold = useMemo(() => content?.length > 84, [content]);
|
|
|
|
|
|
|
|
|
|
|
|
const handleToggle = () => {
|
|
|
|
const handleToggle = () => {
|
|
|
|
setIsFold(!isFold);
|
|
|
|
setIsFold(!isFold);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
|
|
|
|
<div className="relative text-[#000000b2] text-[15px] mt-[15px] mb-[36px]">
|
|
|
|
return content ? (
|
|
|
|
|
|
|
|
<div className="relative text-[#000000b2] text-[15px] mt-[15px]">
|
|
|
|
<article
|
|
|
|
<article
|
|
|
|
className={`leading-[25px] overflow-hidden ${isFold && 'h-[96px]'}`}
|
|
|
|
className={`leading-[25px] overflow-hidden ${showFold && isFold && 'h-[96px]'}`}
|
|
|
|
dangerouslySetInnerHTML={{ __html: content }}
|
|
|
|
dangerouslySetInnerHTML={{ __html: content }}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{isFold && (
|
|
|
|
{showFold && (
|
|
|
|
<div className="absolute w-full h-[96px] top-0 left-0 bg-gradient-to-b from-[#ffffff00] to-[#fffffff2]" />
|
|
|
|
<>
|
|
|
|
|
|
|
|
{isFold && (
|
|
|
|
|
|
|
|
<div className="absolute w-full h-[96px] top-0 left-0 bg-gradient-to-b from-[#ffffff00] to-[#fffffff2]" />
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
<div className="relative flex items-center text-[15px] pt-[17px]" onClick={handleToggle}>
|
|
|
|
|
|
|
|
{isFold ? (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
展开
|
|
|
|
|
|
|
|
<Icon name="icon_arrow_down" />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
收起
|
|
|
|
|
|
|
|
<Icon name="icon_arrow_up" />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<div className="relative flex items-center text-[15px] pt-[17px]" onClick={handleToggle}>
|
|
|
|
|
|
|
|
{isFold ? (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
展开
|
|
|
|
|
|
|
|
<Icon name="icon_arrow_down" />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
收起
|
|
|
|
|
|
|
|
<Icon name="icon_arrow_up" />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
) : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|