diff --git a/src/pages/resources/search.tsx b/src/pages/resources/search.tsx index e69de29..438e01d 100644 --- a/src/pages/resources/search.tsx +++ b/src/pages/resources/search.tsx @@ -0,0 +1,161 @@ +import { type PaymentType, type Platform, type RangeInput, type Skill, type SkillLevel } from "@prisma/client" +import { useState } from "react"; + +type QuestionTypes = Platform | Skill | SkillLevel | PaymentType | RangeInput; + +interface Option { + label: string, + value: T, +} + +interface Question { + header: string, + options: Option[] +} + +const questions: Question[] = [ + { + header: "Age of Patient", + options: [ + { + label: "Child", + value: {min: 0, max: 9} + }, + { + label: "Teen", + value: {min: 10, max:20} + }, + { + label: "Adult", + value: {min: 21, max: 100} + }, + ], + }, + { + header: "Desired Platforms", + options: [ + { + label: "Apple (iOS)", + value: "APP_IOS", + }, + { + label: "Android", + value: "APP_ANDROID", + }, + { + label: "Web-Based", + value: "WEBSITE", + }, + { + label: "PDF (printable)", + value: "PDF", + } + ] + }, + { + header: "Skill Level", + options: [ + { + label: "Beginner", + value: "BEGINNER", + }, + { + label: "Intermediate", + value: "INTERMEDIATE", + }, + { + label: "Advanced", + value: "ADVANCED", + } + ] + }, + { + header: "Skills Practiced", + options: [ + { + label: "Phonemes", + value: "PHONEMES", + }, + { + label: "Words", + value: "WORDS", + }, + { + label: "Sentence", + value: "SENTENCES", + }, + { + label: "Discourse/Complex", + value: "DISCOURSE", + }, + { + label: "Music", + value: "MUSIC", + }, + { + label: "Environmental Sounds", + value: "ENVIRONMENT", + }, + ] + } +] + +const ChoiceQuestion = ({question}: {question: Question}) => { + const Option = ({option}: {option: Option}) => { + const [selected, setSelected] = useState(false); + + const handleToggle = () => { + setSelected(!selected); + } + + return ( +
+ +
+ ) + } + + const optionsComponents = question.options.map((option, index) => { + return