Purifying non-compliant - purify losses?

Assalamu 'alaykum wa rahmatullahi wa barakatuh

I bought a share that I later found was non-compliant. I’ve now sold it but at a significant loss (I.e I bought it at say £20 but now it’s £10, so I’m -£10)

Am I right in assuming that I need to do nothing as I have no profits to purify?

What about dividends I received during the time I held the share - do I purify with 5% as usual or purify it all?