mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 23:05:52 +08:00
fix: style of api-key generate modal
This commit is contained in:
parent
a01e2e4135
commit
e114334c18
@ -2,20 +2,18 @@
|
|||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
import { t } from 'i18next'
|
import { t } from 'i18next'
|
||||||
import s from './style.module.css'
|
|
||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
|
import CopyFeedback from '@/app/components/base/copy-feedback'
|
||||||
|
|
||||||
type IInputCopyProps = {
|
type IInputCopyProps = {
|
||||||
value?: string
|
value?: string
|
||||||
className?: string
|
className?: string
|
||||||
readOnly?: boolean
|
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
const InputCopy = ({
|
const InputCopy = ({
|
||||||
value = '',
|
value = '',
|
||||||
className,
|
className,
|
||||||
readOnly = true,
|
|
||||||
children,
|
children,
|
||||||
}: IInputCopyProps) => {
|
}: IInputCopyProps) => {
|
||||||
const [isCopied, setIsCopied] = useState(false)
|
const [isCopied, setIsCopied] = useState(false)
|
||||||
@ -45,23 +43,12 @@ const InputCopy = ({
|
|||||||
popupContent={isCopied ? `${t('appApi.copied')}` : `${t('appApi.copy')}`}
|
popupContent={isCopied ? `${t('appApi.copied')}` : `${t('appApi.copy')}`}
|
||||||
position='bottom'
|
position='bottom'
|
||||||
>
|
>
|
||||||
{value}
|
<span className='text-text-secondary'>{value}</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-4 shrink-0 border bg-divider-regular" />
|
<div className="h-4 w-px shrink-0 bg-divider-regular" />
|
||||||
<Tooltip
|
<div className='mx-1'><CopyFeedback content={value} /></div>
|
||||||
popupContent={isCopied ? `${t('appApi.copied')}` : `${t('appApi.copy')}`}
|
|
||||||
position='bottom'
|
|
||||||
>
|
|
||||||
<div className="shrink-0 px-0.5">
|
|
||||||
<div className={`box-border flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover ${s.copyIcon} ${isCopied ? s.copied : ''}`} onClick={() => {
|
|
||||||
copy(value)
|
|
||||||
setIsCopied(true)
|
|
||||||
}}>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user