Accessing Current Topic Tags in Theme Component

We have created a simple theme component that creates a widget and outputs some HTML. How would we be able to access the tags for a specific topic in the script of theme component, so that we can create if/else for showing the HTML, i.e. if topic.tag == then show HTML etc. Thanks.