Is P value Type I error in hypothesis testing?

I'm confused about the interpretation of P value in hypothesis testing. I know that we set significance level as 0.05 which is the threshold we set for this test so that it won't suffer from Type I error by 5%.

And we are comparing P to significance level, does it mean P is the probability of making type I error based on the sample?

I'm confused about the interpretation of P value in hypothesis testing. I know that we set significance level as 0.05 which is the threshold we set for this test so that it won't suffer from Type I error by 5%.

And we are comparing P to significance level, does it mean P is the probability of making type I error based on the sample?