mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 19:30:04 +08:00
feat: add title to selection action button in compact mode (#6498)
* feat: add title prototype to selection action button in compact mode * fix: optimize the display name logic for action buttons in the selection toolbar
This commit is contained in:
parent
7a255c1b6d
commit
55a5e7c3af
@ -65,8 +65,10 @@ const ActionIcons: FC<{
|
|||||||
|
|
||||||
const renderActionButton = useCallback(
|
const renderActionButton = useCallback(
|
||||||
(action: ActionItem) => {
|
(action: ActionItem) => {
|
||||||
|
const displayName = action.isBuiltIn ? t(action.name) : action.name
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionButton key={action.id} onClick={() => handleAction(action)}>
|
<ActionButton key={action.id} onClick={() => handleAction(action)} title={isCompact ? displayName : undefined}>
|
||||||
<ActionIcon>
|
<ActionIcon>
|
||||||
{action.id === 'copy' ? (
|
{action.id === 'copy' ? (
|
||||||
renderCopyIcon()
|
renderCopyIcon()
|
||||||
@ -79,9 +81,7 @@ const ActionIcons: FC<{
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
{!isCompact && (
|
{!isCompact && <ActionTitle className="btn-title">{displayName}</ActionTitle>}
|
||||||
<ActionTitle className="btn-title">{action.isBuiltIn ? t(action.name) : action.name}</ActionTitle>
|
|
||||||
)}
|
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user