'use client' import type { FC } from 'react' import React from 'react' import { RiArrowRightUpLine, RiBugLine, } from '@remixicon/react' import { useTranslation } from 'react-i18next' import KeyValueItem from '../base/key-value-item' import Tooltip from '@/app/components/base/tooltip' import Button from '@/app/components/base/button' import { useDebugKey } from '@/service/use-plugins' const i18nPrefix = 'plugin.debugInfo' const DebugInfo: FC = () => { const { t } = useTranslation() const { data: info, isLoading } = useDebugKey() // info.key likes 4580bdb7-b878-471c-a8a4-bfd760263a53 mask the middle part using *. const maskedKey = info?.key?.replace(/(.{8})(.*)(.{8})/, '$1********$3') if (isLoading) return null return (
{t(`${i18nPrefix}.title`)} {t(`${i18nPrefix}.viewDocs`)}
} popupClassName='flex flex-col items-start w-[256px] px-4 py-3.5 gap-1 border border-components-panel-border rounded-xl bg-components-tooltip-bg shadows-shadow-lg z-50' asChild={false} position='bottom' >
) } export default React.memo(DebugInfo)