I am trying to add a dropdown, in which the option elements were added into a separate file.
Store.js
export const consultationOptinList = {
options: [
{
id: 1,
label: "Preview Survey",
action: () => navigate("/public-consultation-preview"),
icon: "eye",
},
{
id: 2,
label: "Resend Survey",
action: handleMenus,
icon: "envelope",
},
{
id: 3,
label: "Update Respondents",
action: handleMenus,
icon: "comment-pen",
},
],
}
Then this value is imported and added to the component.
content.tsx
import { consultationOptinList } from "FormContainer/store";
...
...
<ListOptions
options={consultationOptinList.options}
className="dropdownBtn"
tab={tab}
/>
Inside the component props is defined like this
type Props = {
...
options?: DropDown[];
tab?: string;
...
};
DropDown type is defined like this.
export type DropDown = {
id: number;
action: () => void;
label: string;
icon: IconName;
};
But I am facing an issue
(property) options?: DropDown[] | undefined Type '{ id: number; label: string; action: any; icon: string; }[]' is not assignable to type 'DropDown[]'. Type '{ id: number; label: string; action: any; icon: string; }' is not assignable to type 'DropDown'. Types of property 'icon' are incompatible. Type 'string' is not assignable to type 'IconName'.ts(2322) index.tsx(29, 3): The expected type comes from property 'options' which is declared here on type 'IntrinsicAttributes & Props'
I am confused as to solve this error. Please give me some suggestions to fix this error.

IconName?