feat: template transform code tooltip

This commit is contained in:
Joel
2024-02-21 13:55:07 +08:00
parent 671654da71
commit 65ac4dedcc
5 changed files with 30 additions and 12 deletions

View File

@ -42,8 +42,8 @@ const Base: FC<Props> = ({
return (
<div className={cn(className, 'rounded-lg border', isFocus ? 'bg-white border-gray-200' : 'bg-gray-100 border-gray-100')}>
<div className='flex justify-between items-center h-7 pt-1 pl-3 pr-1'>
<div className=''>{title}</div>
<div className='flex'>
<div className='text-xs font-semibold text-gray-700'>{title}</div>
<div className='flex items-center'>
{headerRight}
{!isCopied
? (

View File

@ -7,12 +7,14 @@ type Props = {
value: string
onChange: (value: string) => void
title: JSX.Element
headerRight?: JSX.Element
}
const CodeEditor: FC<Props> = ({
value,
onChange,
title,
headerRight,
}) => {
const [isFocus, setIsFocus] = React.useState(false)
@ -21,6 +23,7 @@ const CodeEditor: FC<Props> = ({
<Base
title={title}
value={value}
headerRight={headerRight}
isFocus={isFocus}
minHeight={86}
>