-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
47 lines (40 loc) · 1.51 KB
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { useState } from 'react';
import IntroductionPage from './Components/IntroductionPage';
import InputField from './Components/InputField';
import Button from './Components/Button';
import MarkdownPreviewContainer from './Components/MarkdownPreviewContainer';
import './App.css'; // Import CSS file
function App() {
const [showInputPage, setShowInputPage] = useState(false);
const [markdown, setMarkdown] = useState('');
const handleGetStarted = () => {
setShowInputPage(true);
};
const handleGenerateMarkdown = (generatedMarkdown) => {
setMarkdown(generatedMarkdown);
};
const fields = [
{ name: 'projectTitle', label: 'Project Title' },
{ name: 'description', label: 'Description', type: 'textarea' },
{ name: 'installation', label: 'Installation', type: 'textarea' },
{ name: 'usage', label: 'Usage', type: 'textarea' },
{ name: 'contributing', label: 'Contributing', type: 'textarea' },
{ name: 'license', label: 'License' },
// Add more fields as needed
];
return (
<div>
{showInputPage ? (
<div className="input-container">
<InputField fields={fields} onGenerateMarkdown={handleGenerateMarkdown} />
{/* <Button onClick={() => {}}>Submit</Button> */}
</div>
) : (
<IntroductionPage onGetStarted={handleGetStarted} />
)}
{/* Render Markdown content outside the yellow line box */}
{markdown && <div className="markdown-content">{markdown}</div>}
</div>
);
}
export default App;