mirror of
https://github.com/fmhy/edit.git
synced 2025-08-01 00:32:30 +10:00
more stuf
This commit is contained in:
parent
16bf6230c0
commit
639b22781b
11 changed files with 31 additions and 193 deletions
35
website/types.ts
Normal file
35
website/types.ts
Normal 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>;
|
Loading…
Add table
Add a link
Reference in a new issue