How can I represent an accordion's information in Typescript classes. I've a Product page which shows an accordion with its information. Each product, has its own accordion structure (different titles, subtitles, text content and images)

I'd show you how is the structure of this GUI element:

Expanded with a single subtitle: enter image description here

Expanded with several subtitles: enter image description here

Also, I've two more scenarios:

  1. When expanded, It may be no subtitle, just text content.
  2. After a subtitle, It could have one or more images attached.

How could I represent this kind of information with Typescript Classes? I need some guidance.

New contributor
Lucas David Ferrero is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.