-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85daaeb
commit 82ec6cc
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import tw from 'tailwind-styled-components'; | ||
|
||
import Builder from '../components/build/Builder'; | ||
|
||
const BuildPage: React.FC = () => { | ||
return ( | ||
<Container> | ||
<ContentWrapper> | ||
<div className="mb-4 flex w-full justify-center"> | ||
<img className="w-64" src="/stackwise_logo.png" /> | ||
</div> | ||
<Builder /> | ||
</ContentWrapper> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default BuildPage; | ||
|
||
const Container = tw.div` | ||
flex | ||
flex-col | ||
justify-center | ||
items-center | ||
w-full | ||
h-screen | ||
`; | ||
|
||
const ContentWrapper = tw.div` | ||
w-3/5 | ||
flex | ||
flex-col | ||
justify-center | ||
items-center | ||
mt-10 | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import tw from 'tailwind-styled-components'; | ||
|
||
const Builder: React.FC = () => { | ||
const [input, setInput] = useState<string>( | ||
'Using GPT, summarize all of my Git commits in the last month', | ||
); | ||
const [loading, setLoading] = useState(false); | ||
|
||
const handleSubmit = async () => { | ||
setLoading(true); | ||
|
||
// This is where the API call would go | ||
|
||
setLoading(false); | ||
}; | ||
|
||
return ( | ||
<BuilderWrapper> | ||
<BuilderInput value={input} onChange={(e) => setInput(e.target.value)} /> | ||
<Button | ||
onClick={handleSubmit} | ||
type="submit" | ||
disabled={loading} | ||
className={`${loading && 'bg-black text-white'}`} | ||
> | ||
Submit | ||
</Button> | ||
</BuilderWrapper> | ||
); | ||
}; | ||
|
||
export default Builder; | ||
|
||
const BuilderWrapper = tw.div` | ||
flex | ||
w-full | ||
flex-col | ||
items-center | ||
justify-center | ||
`; | ||
|
||
const BuilderInput = tw.textarea` | ||
w-1/2 | ||
p-2 | ||
mb-2 | ||
border | ||
border-gray-300 | ||
bg-gray-50 | ||
rounded | ||
resize-none | ||
focus:outline-none | ||
h-24 | ||
`; | ||
|
||
const Button = tw.button` | ||
rounded-md border border-black px-3 py-1 font-medium | ||
`; |