I have a list of different statuses
Here is an example of it:
export enum InvoiceStatus {
Created = 1,
Pending = 2,
Approved = 3,
Rejected = 4,
Paid = 5,
Deleted = 6,
PreparingPayment = 7
}
My goal is to convert it into an array of type SelectItem
export interface SelectItem {
label?: string;
value: any;
styleClass?: string;
icon?: string;
title?: string;
disabled?: boolean;
}
I want to assign the name of the status as the label and its corresponding value
Any suggestions on how I can achieve this?