Max: 1 mint per wallet

Hello everyone! I am super new to sol and web3 contracts. I am looking to add a feature into my contract where -

Wallets have a max amount of 1 mint per wallet.

I want there to be a statement where if it is true ==> people can only mint 1 nft per wallet.

If the statement is false ==> then people can mint more then 1 nft per wallet.

(I am doing this for whitelist and struggling to find a way to implement it) Thanks!

typing out the code would be very helpful as i am a visual learner! Appreciate you ahead of time

I am not sure what you want to do, maybe you can add two variable to have a check when users want to mint new NFT.

bool public onlyOnce;
mapping(address => bool) public hasMint;