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