@@ -23,6 +23,8 @@ const App: React.FC = () => {
2323 const [ generatedContent , setGeneratedContent ] = useState ( '' ) ;
2424 const [ snackbarOpen , setSnackbarOpen ] = useState ( false ) ;
2525 const [ snackbarMessage , setSnackbarMessage ] = useState ( '' ) ;
26+ const [ promptModalOpen , setPromptModalOpen ] = useState ( false ) ;
27+ const [ promptContent , setPromptContent ] = useState ( '' ) ;
2628
2729 const handleFormSubmit = ( content : string ) => {
2830 setGeneratedContent ( content ) ;
@@ -64,6 +66,23 @@ const App: React.FC = () => {
6466 setSnackbarOpen ( false ) ;
6567 } ;
6668
69+ const handleOpenPromptModal = async ( ) => {
70+ try {
71+ const response = await fetch ( 'https://raw.githubusercontent.com/Agentic-Insights/codebase-context-spec/main/GENERATE-CONTEXT-PROMPT.md' ) ;
72+ const content = await response . text ( ) ;
73+ setPromptContent ( content ) ;
74+ setPromptModalOpen ( true ) ;
75+ } catch ( error ) {
76+ console . error ( 'Error fetching GENERATE-CONTEXT-PROMPT.md:' , error ) ;
77+ setSnackbarMessage ( 'Error fetching prompt content' ) ;
78+ setSnackbarOpen ( true ) ;
79+ }
80+ } ;
81+
82+ const handleClosePromptModal = ( ) => {
83+ setPromptModalOpen ( false ) ;
84+ } ;
85+
6786 return (
6887 < ThemeProvider theme = { theme } >
6988 < Router basename = { BASE_PATH } >
@@ -77,12 +96,19 @@ const App: React.FC = () => {
7796 < Typography variant = "body1" paragraph >
7897 This editor helps you create .context.md, .contextdocs.md, and .contextignore files for your project.
7998 </ Typography >
80- < Typography variant = "body1" paragraph >
81- GitHub Repository:{ ' ' }
82- < MuiLink href = "https://github.com/Agentic-Insights/codebase-context-spec" target = "_blank" rel = "noopener noreferrer" >
83- https://github.com/Agentic-Insights/codebase-context-spec
84- </ MuiLink >
85- </ Typography >
99+ < div className = "link-section" >
100+ < Typography variant = "body1" paragraph >
101+ GitHub Repository:{ ' ' }
102+ < MuiLink href = "https://github.com/Agentic-Insights/codebase-context-spec" target = "_blank" rel = "noopener noreferrer" >
103+ https://github.com/Agentic-Insights/codebase-context-spec
104+ </ MuiLink >
105+ </ Typography >
106+ < Typography variant = "body1" paragraph >
107+ < MuiLink href = "#" onClick = { handleOpenPromptModal } >
108+ View GENERATE-CONTEXT-PROMPT
109+ </ MuiLink >
110+ </ Typography >
111+ </ div >
86112 < NavTabs />
87113 < Box className = "form-section" >
88114 < Routes >
@@ -148,6 +174,29 @@ const App: React.FC = () => {
148174 </ Box >
149175 </ Modal >
150176
177+ < Modal
178+ open = { promptModalOpen }
179+ onClose = { handleClosePromptModal }
180+ aria-labelledby = "prompt-modal-title"
181+ aria-describedby = "prompt-modal-description"
182+ >
183+ < Box className = "modal-content" >
184+ < Box display = "flex" justifyContent = "space-between" alignItems = "center" mb = { 2 } >
185+ < Typography id = "prompt-modal-title" variant = "h6" component = "h2" >
186+ GENERATE-CONTEXT-PROMPT
187+ </ Typography >
188+ < IconButton onClick = { handleClosePromptModal } size = "small" >
189+ < CloseIcon />
190+ </ IconButton >
191+ </ Box >
192+ < Box className = "code-preview" >
193+ < pre >
194+ { promptContent }
195+ </ pre >
196+ </ Box >
197+ </ Box >
198+ </ Modal >
199+
151200 < Snackbar
152201 anchorOrigin = { {
153202 vertical : 'bottom' ,
0 commit comments