ui: Improve performance in the `CopyButton` component (#47292)

This PR improves the performance of the `CopyButton` component by
tracking the copied state locally through a `CopyButtonState` struct
instead of making an OS call every time the component re-renders. Also
pushing a slight improvement here by resetting the state after two
seconds so as to make the check mark go away after you clicked to copy.

Release Notes:

- N/A
e1e7676b5aDanilo Leal committed on 1/21/2026, 4:40:42 PM· committed by GitHubparent099650f
11 files changedLine totals unavailable