mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:06:51 +08:00
refactor(billing): use Infotip for UsageInfo help icon, migrate storage tooltip to dify-ui (#35448)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
dc83e8aa09
commit
051ba99cd2
@ -2218,11 +2218,6 @@
|
||||
"count": 3
|
||||
}
|
||||
},
|
||||
"web/app/components/billing/usage-info/index.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"web/app/components/datasets/common/image-previewer/index.tsx": {
|
||||
"no-irregular-whitespace": {
|
||||
"count": 1
|
||||
|
||||
@ -309,7 +309,7 @@ describe('UsageInfo', () => {
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(container.querySelector('[data-state]')).toBeInTheDocument()
|
||||
expect(container.querySelectorAll('.cursor-default').length).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -3,7 +3,8 @@ import { defaultPlan } from '../../config'
|
||||
import { Plan } from '../../type'
|
||||
import VectorSpaceInfo from '../vector-space-info'
|
||||
|
||||
const queryPlaceholder = () => document.body.querySelector('[aria-hidden="true"]')
|
||||
const queryPlaceholder = () =>
|
||||
document.body.querySelector('[aria-hidden="true"].bg-components-progress-bar-bg')
|
||||
|
||||
// Mock provider context with configurable plan
|
||||
let mockPlanType = Plan.sandbox
|
||||
|
||||
@ -3,9 +3,10 @@ import type { MeterTone } from '@langgenius/dify-ui/meter'
|
||||
import type { ComponentType, FC, ReactNode } from 'react'
|
||||
import { cn } from '@langgenius/dify-ui/cn'
|
||||
import { MeterIndicator, MeterRoot, MeterTrack } from '@langgenius/dify-ui/meter'
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
|
||||
import * as React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import { Infotip } from '@/app/components/base/infotip'
|
||||
import { NUM_INFINITE } from '../config'
|
||||
|
||||
type Props = {
|
||||
@ -159,11 +160,11 @@ const UsageInfo: FC<Props> = ({
|
||||
const wrapWithStorageTooltip = (children: ReactNode) => {
|
||||
if (storageMode && storageTooltip) {
|
||||
return (
|
||||
<Tooltip
|
||||
popupContent={<div className="w-[200px]">{storageTooltip}</div>}
|
||||
asChild={false}
|
||||
>
|
||||
<div className="cursor-default">{children}</div>
|
||||
<Tooltip>
|
||||
<TooltipTrigger render={<div className="cursor-default">{children}</div>} />
|
||||
<TooltipContent className="w-[200px] max-w-[200px]">
|
||||
{storageTooltip}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
@ -178,13 +179,9 @@ const UsageInfo: FC<Props> = ({
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="system-xs-medium text-text-tertiary">{name}</div>
|
||||
{tooltip && (
|
||||
<Tooltip
|
||||
popupContent={(
|
||||
<div className="w-[180px]">
|
||||
{tooltip}
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
<Infotip aria-label={tooltip} popupClassName="w-[180px] max-w-[180px]">
|
||||
{tooltip}
|
||||
</Infotip>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-1 system-md-semibold text-text-primary">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user