mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +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(
|
||||
(action: ActionItem) => {
|
||||
const displayName = action.isBuiltIn ? t(action.name) : action.name
|
||||
|
||||
return (
|
||||
<ActionButton key={action.id} onClick={() => handleAction(action)}>
|
||||
<ActionButton key={action.id} onClick={() => handleAction(action)} title={isCompact ? displayName : undefined}>
|
||||
<ActionIcon>
|
||||
{action.id === 'copy' ? (
|
||||
renderCopyIcon()
|
||||
@ -79,9 +81,7 @@ const ActionIcons: FC<{
|
||||
/>
|
||||
)}
|
||||
</ActionIcon>
|
||||
{!isCompact && (
|
||||
<ActionTitle className="btn-title">{action.isBuiltIn ? t(action.name) : action.name}</ActionTitle>
|
||||
)}
|
||||
{!isCompact && <ActionTitle className="btn-title">{displayName}</ActionTitle>}
|
||||
</ActionButton>
|
||||
)
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user