Skip to content

Commit c6cce94

Browse files
authored
Merge pull request #9 from spivx/add-generate-full-file
Add generate full file
2 parents 0c9531e + b000f76 commit c6cce94

File tree

13 files changed

+692
-235
lines changed

13 files changed

+692
-235
lines changed

app/new/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ import { AnimatedBackground } from "@/components/AnimatedBackground"
88
import { getHomeMainClasses } from "@/lib/utils"
99
import { ANALYTICS_EVENTS } from "@/lib/analytics-events"
1010
import { track } from "@/lib/mixpanel"
11-
import type { FileOutputConfig } from "@/types/wizard"
11+
import type { DataQuestionSource, FileOutputConfig } from "@/types/wizard"
1212
import { Github } from "lucide-react"
1313
import Link from "next/link"
1414

1515
import filesData from "@/data/files.json"
16+
import { buildFileOptionsFromQuestion } from "@/lib/wizard-utils"
17+
18+
const fileQuestionSet = filesData as DataQuestionSource[]
19+
const fileQuestion = fileQuestionSet[0] ?? null
20+
const fileOptionsFromData = buildFileOptionsFromQuestion(fileQuestion)
1621

1722
export default function NewInstructionsPage() {
1823
const [showWizard, setShowWizard] = useState(false)
1924
const [selectedFileId, setSelectedFileId] = useState<string | null>(null)
2025

21-
const fileOptions = useMemo(() => {
22-
return (filesData as FileOutputConfig[]).filter((file) => file.enabled !== false)
23-
}, [])
26+
const fileOptions = useMemo(() => fileOptionsFromData, [])
2427

2528
const handleFileCtaClick = (file: FileOutputConfig) => {
2629
setSelectedFileId(file.id)

0 commit comments

Comments
 (0)