import prisma from "app/lib/db"

export default async function ResponseDropdown() {
	async function getResponses() {
		"use server"
		return prisma.response.findMany()
	}
	const responses = await getResponses()
	const responsesDropdown = responses.map(e => {
		return <option value={e.id} key={e.response}>{e.response}</option>
	})
	return (
		<>
			<label htmlFor="responsesDropdown">
				Status:
			</label>
			<select key="responsesDropdown" id="responsesDropdown">
				{responsesDropdown}
			</select>
		</>
	)
}
