Changesets · Branches · Tags · Compare
| Changeset | 41d4276ca5e3180bc09c6f226b0698da5fe80315f15cd5532c09b8cb02663e34 |
|---|---|
| Author | vldf <vladislavf7@gmail.com> · 2025-08-06 12:19 +03:00 |
| Committer | vldf <vladislavf7@gmail.com> · 2025-08-06 13:11 +03:00 |
| Parents | 4940c71be2bf |
1 file changed
modified gui/src/components/mainInput/Lump/sections/PromptsSection.tsx +6 −2
| @@ -60,6 +60,9 @@ | ||
| 60 | 60 | } |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | + const canEdit = | |
| 64 | + prompt.promptFile && !prompt.promptFile.startsWith("builtin:"); | |
| 65 | + | |
| 63 | 66 | return ( |
| 64 | 67 | <div |
| 65 | 68 | className="hover:bg-list-active hover:text-list-active-foreground flex items-center justify-between gap-3 rounded-md px-2 py-1 hover:cursor-pointer" |
| @@ -78,8 +81,9 @@ | ||
| 78 | 81 | </div> |
| 79 | 82 | <div className="flex items-center gap-2"> |
| 80 | 83 | <PencilIcon |
| 81 | - className="h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125" | |
| 82 | - onClick={handleEditClick} | |
| 84 | + className={`h-3 w-3 cursor-pointer text-gray-400 hover:brightness-125${!canEdit ? "pointer-events-none cursor-not-allowed opacity-50" : ""}`} | |
| 85 | + onClick={canEdit ? handleEditClick : undefined} | |
| 86 | + aria-disabled={!canEdit} | |
| 83 | 87 | /> |
| 84 | 88 | <div |
| 85 | 89 | onClick={handleBookmarkClick} |