What is your intended use for this pc?
I5-10400 has 12 threads a passmark rating of 13411. That is when all 12 threads are fully utilized.
The single thread rating is 2746.
R7-2600x has 16 threads and a higher rating of 17574 but a lower single thread rating of 2437.
For all practical purposes, you could pick either.
If you use is for batch apps where you can utilize all 16 threads, the 2600X is going to be better.
OTOH, the 10400 will come with integrated graphics which is suitable for anything except gaming.
If your main use is for gaming with a discrete graphics card, then the higher single thread performance of the 10400 may well be better. Few games can effectively use more than 4-6 threads. Many games depend on the...