feat: add icons on context menu
This commit is contained in:
parent
7f61ab2a21
commit
6408762f40
@ -1,5 +1,11 @@
|
|||||||
@import 'https://at.alicdn.com/t/c/font_4563475_hrx8c92awui.css';
|
@import 'https://at.alicdn.com/t/c/font_4563475_hrx8c92awui.css';
|
||||||
@import './markdown.scss';
|
@import './markdown.scss';
|
||||||
|
|
||||||
|
// @font-face {
|
||||||
|
// font-family: 'Playwrite';
|
||||||
|
// src: url(../fonts/Playwrite.ttf) format('truetype');
|
||||||
|
// }
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--color-white: #ffffff;
|
--color-white: #ffffff;
|
||||||
--color-white-soft: #f8f8f8;
|
--color-white-soft: #f8f8f8;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { Dropdown, MenuProps } from 'antd'
|
|||||||
import { MoreOutlined } from '@ant-design/icons'
|
import { MoreOutlined } from '@ant-design/icons'
|
||||||
import { last } from 'lodash'
|
import { last } from 'lodash'
|
||||||
import AgentSettingPopup from '@renderer/components/Popups/AgentSettingPopup'
|
import AgentSettingPopup from '@renderer/components/Popups/AgentSettingPopup'
|
||||||
|
import { DeleteOutlined, EditOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
activeAgent: Agent
|
activeAgent: Agent
|
||||||
@ -28,6 +29,7 @@ const Agents: FC<Props> = ({ activeAgent, onActive }) => {
|
|||||||
{
|
{
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
key: 'edit',
|
key: 'edit',
|
||||||
|
icon: <EditOutlined />,
|
||||||
async onClick() {
|
async onClick() {
|
||||||
if (targetAgent.current) {
|
if (targetAgent.current) {
|
||||||
const _agent = await AgentSettingPopup.show({ agent: targetAgent.current })
|
const _agent = await AgentSettingPopup.show({ agent: targetAgent.current })
|
||||||
@ -39,6 +41,7 @@ const Agents: FC<Props> = ({ activeAgent, onActive }) => {
|
|||||||
{
|
{
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
key: 'delete',
|
key: 'delete',
|
||||||
|
icon: <DeleteOutlined />,
|
||||||
danger: true,
|
danger: true,
|
||||||
onClick: () => targetAgent.current && onDelete(targetAgent.current)
|
onClick: () => targetAgent.current && onDelete(targetAgent.current)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { Agent, Topic } from '@renderer/types'
|
|||||||
import { Button, Dropdown, MenuProps, Popconfirm } from 'antd'
|
import { Button, Dropdown, MenuProps, Popconfirm } from 'antd'
|
||||||
import { FC, useRef } from 'react'
|
import { FC, useRef } from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import { DeleteOutlined } from '@ant-design/icons'
|
import { DeleteOutlined, EditOutlined, SignatureOutlined } from '@ant-design/icons'
|
||||||
import LocalStorage from '@renderer/services/storage'
|
import LocalStorage from '@renderer/services/storage'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -22,8 +22,9 @@ const TopicList: FC<Props> = ({ agent, activeTopic, setActiveTopic }) => {
|
|||||||
|
|
||||||
const topicMenuItems: MenuProps['items'] = [
|
const topicMenuItems: MenuProps['items'] = [
|
||||||
{
|
{
|
||||||
label: 'AI Rename',
|
label: 'Auto Rename',
|
||||||
key: 'ai-rename',
|
key: 'auto-rename',
|
||||||
|
icon: <SignatureOutlined />,
|
||||||
async onClick() {
|
async onClick() {
|
||||||
if (currentTopic.current) {
|
if (currentTopic.current) {
|
||||||
const messages = await LocalStorage.getTopicMessages(currentTopic.current.id)
|
const messages = await LocalStorage.getTopicMessages(currentTopic.current.id)
|
||||||
@ -39,6 +40,7 @@ const TopicList: FC<Props> = ({ agent, activeTopic, setActiveTopic }) => {
|
|||||||
{
|
{
|
||||||
label: 'Rename',
|
label: 'Rename',
|
||||||
key: 'rename',
|
key: 'rename',
|
||||||
|
icon: <EditOutlined />,
|
||||||
async onClick() {
|
async onClick() {
|
||||||
const name = await PromptPopup.show({
|
const name = await PromptPopup.show({
|
||||||
title: 'Rename Topic',
|
title: 'Rename Topic',
|
||||||
@ -58,6 +60,7 @@ const TopicList: FC<Props> = ({ agent, activeTopic, setActiveTopic }) => {
|
|||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
danger: true,
|
danger: true,
|
||||||
key: 'delete',
|
key: 'delete',
|
||||||
|
icon: <DeleteOutlined />,
|
||||||
onClick() {
|
onClick() {
|
||||||
if (agent.topics.length === 1) return
|
if (agent.topics.length === 1) return
|
||||||
currentTopic.current && removeTopic(currentTopic.current)
|
currentTopic.current && removeTopic(currentTopic.current)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user