Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
0dfa1735
Commit
0dfa1735
authored
Jan 05, 2026
by
Will Binns-Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! feat: add GitHub Discussion Router app
parent
3b97df09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
89 deletions
+3
-89
search-form.tsx
apps/gh-discussion-router/components/search-form.tsx
+0
-70
env.ts
apps/gh-discussion-router/lib/env.ts
+3
-19
No files found.
apps/gh-discussion-router/components/search-form.tsx
deleted
100644 → 0
View file @
3b97df09
'use client'
import
{
useState
}
from
'react'
import
{
useRouter
}
from
'next/navigation'
import
{
Button
}
from
'@/components/ui/button'
import
{
Search
}
from
'lucide-react'
export
function
SearchForm
()
{
const
router
=
useRouter
()
const
[
title
,
setTitle
]
=
useState
(
''
)
const
[
description
,
setDescription
]
=
useState
(
''
)
const
handleSubmit
=
(
e
:
React
.
FormEvent
)
=>
{
e
.
preventDefault
()
if
(
!
title
.
trim
())
return
const
params
=
new
URLSearchParams
({
title
:
title
.
trim
(),
})
if
(
description
.
trim
())
{
params
.
set
(
'description'
,
description
.
trim
())
}
router
.
push
(
`/search?
${
params
.
toString
()}
`
)
}
return
(
<
form
onSubmit=
{
handleSubmit
}
className=
"space-y-4"
>
<
div
className=
"space-y-2"
>
<
label
htmlFor=
"title"
className=
"block text-sm font-medium text-foreground"
>
Discussion Title *
</
label
>
<
input
id=
"title"
type=
"text"
value=
{
title
}
onChange=
{
(
e
)
=>
setTitle
(
e
.
target
.
value
)
}
placeholder=
"Enter discussion title..."
required
className=
"w-full px-4 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
/>
</
div
>
<
div
className=
"space-y-2"
>
<
label
htmlFor=
"description"
className=
"block text-sm font-medium text-foreground"
>
Description (optional)
</
label
>
<
textarea
id=
"description"
value=
{
description
}
onChange=
{
(
e
)
=>
setDescription
(
e
.
target
.
value
)
}
placeholder=
"Enter description..."
rows=
{
4
}
className=
"w-full px-4 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"
/>
</
div
>
<
Button
type=
"submit"
className=
"w-full"
disabled=
{
!
title
.
trim
()
}
>
<
Search
className=
"mr-2 h-4 w-4"
/>
Search Discussions
</
Button
>
</
form
>
)
}
apps/gh-discussion-router/lib/env.ts
View file @
0dfa1735
...
@@ -18,27 +18,11 @@ const envSchema = z.object({
...
@@ -18,27 +18,11 @@ const envSchema = z.object({
.
pipe
(
z
.
number
().
positive
()),
.
pipe
(
z
.
number
().
positive
()),
})
})
let
cachedEnv
:
z
.
infer
<
typeof
envSchema
>
|
null
=
null
export
const
env
=
Object
.
freeze
(
envSchema
.
parse
({
function
getEnv
()
{
if
(
cachedEnv
)
{
return
cachedEnv
}
cachedEnv
=
envSchema
.
parse
({
GITHUB_TOKEN
:
process
.
env
.
GITHUB_TOKEN
,
GITHUB_TOKEN
:
process
.
env
.
GITHUB_TOKEN
,
GITHUB_REPO
:
process
.
env
.
GITHUB_REPO
,
GITHUB_REPO
:
process
.
env
.
GITHUB_REPO
,
SIMILARITY_THRESHOLD
:
process
.
env
.
SIMILARITY_THRESHOLD
,
SIMILARITY_THRESHOLD
:
process
.
env
.
SIMILARITY_THRESHOLD
,
MAX_DISCUSSIONS_TO_FETCH
:
process
.
env
.
MAX_DISCUSSIONS_TO_FETCH
,
MAX_DISCUSSIONS_TO_FETCH
:
process
.
env
.
MAX_DISCUSSIONS_TO_FETCH
,
})
})
)
return
cachedEnv
}
export
const
env
=
new
Proxy
({}
as
z
.
infer
<
typeof
envSchema
>
,
{
get
(
_target
,
prop
)
{
return
getEnv
()[
prop
as
keyof
z
.
infer
<
typeof
envSchema
>
]
},
})
export
type
Env
=
z
.
infer
<
typeof
envSchema
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment