The minimal primes of $\mathscr{O}_{X,p}$ are in canonical bijection with the irreducible components of $X$ passing through $p$. I wonder how to prove

Let $X$ be a scheme. The minimal primes of $\mathscr{O}_{X,p}$ are in canonical bijection with the irreducible components of $X$ passing through $p$.(Source)

This is easy when $X=\operatorname {Spec} A$. In general, I think I need to find a generic point of some irreducible component based on this minimal ideal. But I don't know how to construct the bijection. 
I feel like this is a theorem in algebraic geometry textbooks. If the proof is rather complicated, I really appreciate it if you can show me where to find it.
 A: The general case follows immediately from the affine case.  More generally, if $X$ is a scheme, $p\in X$, and $U\subseteq X$ is an open subscheme containing $p$, then the irreducible closed subsets of $X$ which contain $p$ are exactly the closures in $X$ of the irreducible closed subsets of $U$ which contain $p$.  Indeed, if $A\subseteq U$ is irreducible and closed in $U$ and contains $p$, then its closure $\overline{A}$ in $X$ is irreducible and closed in $X$ and contains $p$.  Conversely, if $B\subseteq X$ is irreducible and closed and contains $p$, then $A=B\cap U$ is irreducible and closed in $U$ and contains $p$.  We have $B=\overline{A}\cup (B\setminus U)$ where both $\overline{A}$ and $B\setminus U$ are closed, so by irreducibility one of them must be all of $B$.  Since $p\in B$, $B\setminus U$ is not all of $B$, so $\overline{A}=B$.
Since irreducible components are just maximal irreducible closed subsets of $X$, the irreducible components of $X$ containing $p$ are the closures of the irreducible components of $U$ containing $p$.  Taking $U$ to be affine, these irreducible components correspond to minimal primes of $\mathscr{O}_{X,p}$, so we're done.
