mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-31 02:06:21 +00:00
* style(web-shell): polish chat UI * fix(web-shell): address chat polish review feedback --------- Co-authored-by: ytahdn <ytahdn@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import autoIconUrl from '../assets/icons/auto.svg';
|
|
import defaultIconUrl from '../assets/icons/default.svg';
|
|
import editIconUrl from '../assets/icons/edit.svg';
|
|
import planIconUrl from '../assets/icons/plan.svg';
|
|
import yoloIconUrl from '../assets/icons/yolo.svg';
|
|
import { cssUrlVar } from '../utils/cssUrlVar';
|
|
import styles from './ModeIcon.module.css';
|
|
|
|
const modeIconUrls: Record<string, string> = {
|
|
auto: autoIconUrl,
|
|
'auto-edit': editIconUrl,
|
|
default: defaultIconUrl,
|
|
plan: planIconUrl,
|
|
yolo: yoloIconUrl,
|
|
};
|
|
|
|
export function ModeIcon({ mode }: { mode: string }) {
|
|
const iconUrl = modeIconUrls[mode];
|
|
|
|
if (iconUrl) {
|
|
return (
|
|
<span
|
|
className={styles.icon}
|
|
style={cssUrlVar('--mode-icon-url', iconUrl)}
|
|
aria-hidden="true"
|
|
/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
<path
|
|
d="M6 18c.7-2.7 2.2-4 4.5-4H12M7 6h10M7 10h7M17.5 14.5l2 2-2 2"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
strokeWidth="1.8"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
/>
|
|
</svg>
|
|
);
|
|
}
|