mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
✨ feat(hotkeys): display platform specific key
This commit is contained in:
@@ -26,6 +26,10 @@ const useStyles = createStyles(
|
||||
`,
|
||||
);
|
||||
|
||||
const HOTKEY_MAPPINGS: Partial<Record<string, string>> = {
|
||||
alt: 'option',
|
||||
};
|
||||
|
||||
export interface HotKeysProps {
|
||||
desc?: string;
|
||||
keys: string;
|
||||
@@ -33,7 +37,10 @@ export interface HotKeysProps {
|
||||
|
||||
const HotKeys = memo<HotKeysProps>(({ keys, desc }) => {
|
||||
const { styles } = useStyles();
|
||||
const keysGroup = keys.split('+').filter(Boolean);
|
||||
const keysGroup = keys
|
||||
.split('+')
|
||||
.filter(Boolean)
|
||||
.map((k) => HOTKEY_MAPPINGS[k] ?? k);
|
||||
const content = (
|
||||
<Flexbox align={'center'} className={styles} gap={2} horizontal>
|
||||
{keysGroup.map((key, index) => (
|
||||
|
||||
Reference in New Issue
Block a user