'use client' import { useBoolean } from 'ahooks' import type { FC } from 'react' import React, { useEffect } from 'react' import { useTranslation } from 'react-i18next' import cn from '@/utils/classnames' import { Settings04 } from '@/app/components/base/icons/src/vender/line/general' import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows' const I18N_PREFIX = 'datasetCreation.stepOne.website' type Props = { className?: string children: React.ReactNode controlFoldOptions?: number } const OptionsWrap: FC = ({ className = '', children, controlFoldOptions, }) => { const { t } = useTranslation() const [fold, { toggle: foldToggle, setTrue: foldHide, }] = useBoolean(false) useEffect(() => { if (controlFoldOptions) foldHide() // eslint-disable-next-line react-hooks/exhaustive-deps }, [controlFoldOptions]) return (
{t(`${I18N_PREFIX}.options`)}
{!fold && (
{children}
)}
) } export default React.memo(OptionsWrap)