feat: Add commandMenuIcon function to ChatPanel
This commit adds the `commandMenuIcon` function to the `ChatPanel` component in `index.tsx`. This function returns an icon based on the given pattern. The function is used to display different icons for different patterns in the command menu.
This commit is contained in:
parent
b79e69e5af
commit
79cb2fd8d2
@ -215,6 +215,24 @@ const chatPanel = () => {
|
|||||||
});
|
});
|
||||||
}, [registed]);
|
}, [registed]);
|
||||||
|
|
||||||
|
const commandMenuIcon = (pattern: string) => {
|
||||||
|
if (pattern === 'code') {
|
||||||
|
return (<IconShellCommand size={16}
|
||||||
|
color='var(--vscode-menu-foreground)'
|
||||||
|
style={{
|
||||||
|
marginTop: 8,
|
||||||
|
marginLeft: 12,
|
||||||
|
}} />);
|
||||||
|
}
|
||||||
|
if (pattern === 'commit_message') {
|
||||||
|
return (<IconBook size={16}
|
||||||
|
color='var(--vscode-menu-foreground)'
|
||||||
|
style={{
|
||||||
|
marginTop: 8,
|
||||||
|
marginLeft: 12,
|
||||||
|
}} />);
|
||||||
|
}
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let filtered = commandMenus;
|
let filtered = commandMenus;
|
||||||
if (input) {
|
if (input) {
|
||||||
@ -244,13 +262,7 @@ const chatPanel = () => {
|
|||||||
aria-checked={index === currentMenuIndex}
|
aria-checked={index === currentMenuIndex}
|
||||||
data-pattern={pattern}
|
data-pattern={pattern}
|
||||||
>
|
>
|
||||||
<IconTerminal2
|
{commandMenuIcon(pattern)}
|
||||||
size={16}
|
|
||||||
color='var(--vscode-menu-foreground)'
|
|
||||||
style={{
|
|
||||||
marginTop: 8,
|
|
||||||
marginLeft: 8,
|
|
||||||
}} />
|
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text sx={{
|
<Text sx={{
|
||||||
fontSize: 'sm',
|
fontSize: 'sm',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user