How to force render same id with same data?

I have some card components (soldItems, createdItems) with same data, so this mean created items and sold items both are owned by creator and displayed on his profile, i want to show soldItem if it solded and don’t show createdItem if it solded …

Example:

SoldItem.filter((sold)=>{
CreatedItem.filter((created)=>{
   if(sold.id === created.id){
   console.log("matched");
   // In case its matched i want to show one of them not both
}else{
   console.log("not matched")
}
})
})