Supabase generated enum type to array
Hello,
When we generate the types with
We have something like this
Enums: {
I would like to use the enum list to generate a select in a form.
How can I get something like
so I can use it like this :
Thanks for your help.
When we generate the types with
supabase gen types typescript We have something like this
Enums: {
approvalactionstate: "approve" | "deny" | "cancel"Then we can get the type like this
}
type ApprovalactionstateEnum = Database['public']['Enums']['approvalactionstate']I would like to use the enum list to generate a select in a form.
How can I get something like
const approvalactionstates: ApprovalactionstateEnum[] = ['approve', 'deny', cancel'] so I can use it like this :
{approvalactionstates.map(state => (
<MenuItem key={state} value={state}>
{state}
</MenuItem>
))}Thanks for your help.