'use client' import React, { useState } from 'react' import { useContext } from 'use-context-selector' import StrategyDetailPanel from './strategy-detail' import type { StrategyDetail, } from '@/app/components/plugins/types' import type { Locale } from '@/i18n' import I18n from '@/context/i18n' import { getLanguage } from '@/i18n/language' import cn from '@/utils/classnames' type Props = { provider: { author: string name: string description: Record icon: string label: Record tags: string[] } detail: StrategyDetail } const StrategyItem = ({ provider, detail, }: Props) => { const { locale } = useContext(I18n) const language = getLanguage(locale) const [showDetail, setShowDetail] = useState(false) return ( <>
setShowDetail(true)} >
{detail.identity.label[language]}
{detail.description[language]}
{showDetail && ( setShowDetail(false)} /> )} ) } export default StrategyItem