Merge pull request #5503 from uinstinct/implement-prompt-edit
open config when clicking on editing the prompt
This commit is contained in:
commit
c8c4ea5f6d
1 changed files with 7 additions and 3 deletions
|
|
@ -4,6 +4,8 @@ import {
|
|||
} from "@heroicons/react/24/outline";
|
||||
import { BookmarkIcon as BookmarkSolid } from "@heroicons/react/24/solid";
|
||||
import { SlashCommandDescription } from "core";
|
||||
import { useContext } from "react";
|
||||
import { IdeMessengerContext } from "../../../../context/IdeMessenger";
|
||||
import { useBookmarkedSlashCommands } from "../../../../hooks/useBookmarkedSlashCommands";
|
||||
import { useAppSelector } from "../../../../redux/hooks";
|
||||
import { fontSize } from "../../../../util";
|
||||
|
|
@ -89,14 +91,16 @@ function PromptRow({
|
|||
*/
|
||||
export function PromptsSection() {
|
||||
const { isCommandBookmarked, toggleBookmark } = useBookmarkedSlashCommands();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
const slashCommands = useAppSelector(
|
||||
(state) => state.config.config.slashCommands ?? [],
|
||||
);
|
||||
|
||||
const handleEdit = (prompt: any) => {
|
||||
// Handle edit action here
|
||||
console.log("Editing prompt:", prompt);
|
||||
const handleEdit = (_prompt: SlashCommandDescription) => {
|
||||
ideMessenger.post("config/openProfile", {
|
||||
profileId: undefined,
|
||||
});
|
||||
};
|
||||
|
||||
const sortedCommands = [...slashCommands].sort((a, b) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue