Door sensors and locks

How do people handle a door sensor and a smart lock on the same door? I have them next to each other on a dashboard because I like to make sure the door is shut before I lock the door.

I am wondering if you can create a sensor inside the door unlock lock panel. Any thoughts?

I conditionally show the door sensor only if the door is open and the lock sensor only if the door is closed, so in essence I’m showing 3 states: door open, unlocked and locked. Feels sort of messy but it’s worked well for me for the last few years.