@@ -15,7 +15,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
1515 CodeSyncContext ,
1616 ) as ICodeSyncContext ;
1717 const [ linkCreated , setLinkCreated ] = useState ( false ) ;
18- const [ selectionCopied , setSelectionCopied ] = useState ( false ) ;
1918 const [ sectionTitle , setSectionTitle ] = useState < string | null > ( "" ) ;
2019 const [ subsectionTitle , setSubsectionTitle ] = useState < string | null > ( "" ) ;
2120
@@ -40,29 +39,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
4039 window . setTimeout ( ( ) => setLinkCreated ( false ) , 2000 ) ;
4140 } , [ selectedBlocks ] ) ;
4241
43- const openGpt = useCallback ( ( ) => {
44- const text = selectionString ;
45-
46- const prompt = `
47- Based only on the GrayPaper and within the context of the following quote located on page ${ pageNumber } ${
48- sectionTitle !== null ? `, within section ${ sectionTitle } ` : ""
49- } ${ subsectionTitle ? ` (subsection: ${ subsectionTitle } )` : "" } :
50-
51- ${ text }
52-
53- provide a deep explanation of the above quote with description of all used symbols based on the "Index of Notation" appendix.
54- ` ;
55- window . navigator . clipboard . writeText ( prompt ) ;
56-
57- setSelectionCopied ( true ) ;
58- window . setTimeout ( ( ) => setSelectionCopied ( false ) , 2000 ) ;
59-
60- const a = document . createElement ( "a" ) ;
61- a . target = "_blank" ;
62- a . href = "https://chatgpt.com/g/g-ZuDULS0ij-dzemmer" ;
63- a . click ( ) ;
64- } , [ pageNumber , selectionString , sectionTitle , subsectionTitle ] ) ;
65-
6642 const openNotes = useCallback ( ( ) => {
6743 switchTab ( "notes" ) ;
6844 } , [ switchTab ] ) ;
@@ -98,12 +74,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
9874 < Button onClick = { createLink } tooltip = "Create a shareable link to the selected content." >
9975 { linkCreated ? < span > Copied</ span > : "Link" }
10076 </ Button >
101- < Button
102- onClick = { openGpt }
103- tooltip = "Open a GrayPaper-specific ChatGPT and copy the prompt with selection to clipboard."
104- >
105- { selectionCopied ? < span > Copied</ span > : "Explain" }
106- </ Button >
10777 { activeTab !== "notes" && (
10878 < Button onClick = { openNotes } tooltip = "Create a local note to the selected content." >
10979 Add note
0 commit comments