more stuf

This commit is contained in:
taskylizard 2025-06-27 23:01:52 +00:00
parent 16bf6230c0
commit 639b22781b
No known key found for this signature in database
GPG key ID: 1820131ED1A24120
11 changed files with 31 additions and 193 deletions

35
website/types.ts Normal file
View file

@ -0,0 +1,35 @@
import z from 'zod'
export const FeedbackSchema = z.object({
message: z.string().min(5).max(1000),
type: z.enum(['suggestion', 'appreciation', 'other']),
page: z.string().min(3).max(20),
// For heading based feedback
heading: z.string().min(3).max(20).optional()
})
export interface Option {
label: string
value: FeedbackType['type']
}
export const feedbackOptions: Option[] = [
{
label: '💡 I have a suggestion',
value: 'suggestion'
},
{
label: '👍 I appreciate the work',
value: 'appreciation'
},
{ label: '📂 Something else', value: 'other' }
]
export function getFeedbackOption(
value: FeedbackType['type']
): Option | undefined {
return feedbackOptions.find((option) => option.value === value)
}
// prettier-ignore
export type FeedbackType = z.infer<typeof FeedbackSchema>;