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]);
|
||||
|
||||
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(() => {
|
||||
let filtered = commandMenus;
|
||||
if (input) {
|
||||
@ -244,13 +262,7 @@ const chatPanel = () => {
|
||||
aria-checked={index === currentMenuIndex}
|
||||
data-pattern={pattern}
|
||||
>
|
||||
<IconTerminal2
|
||||
size={16}
|
||||
color='var(--vscode-menu-foreground)'
|
||||
style={{
|
||||
marginTop: 8,
|
||||
marginLeft: 8,
|
||||
}} />
|
||||
{commandMenuIcon(pattern)}
|
||||
<Stack spacing={0}>
|
||||
<Text sx={{
|
||||
fontSize: 'sm',
|
||||
|
Loading…
x
Reference in New Issue
Block a user