I have some data:
export const defaultStatus = 'AVB'
export const prodStatus = {
AVB: 'Available',
DEL: 'Delivered',
PND: 'Pending',
NOT: 'Not available'
}
I need to print a value e.g.
The default status is {prodStatus[defaultStatus]}
It gives an error Element implicitly has an 'any' type because expression of type 'string' can't be used to index type
How do I fix it?
Also, not sure how to define type of prodStatus
... prodStatus: string[]
gives an error too. I am happy to adapt the data structure of prodStatus
if it makes it easier to handle. My main idea is to be able to create a list from this data, allow user to pick one item and then print that value.