S Corp losses

My S Corp will lose money for the fourth straight year. I did make a profit in 2018. So this will be four out of the last 5 years I have lost. My Corp is just about bust due to pandemic and economic conditions.  The corp has no debt. I run it on a cash basis. Can I still claim my losses on my 1040 ? Will the IRS say it’s a hobby now ? I most likely going to close the business in 2023.