Composition vs inheritance?

I have a pick up system to attach weapons to the hand of the player.

I was wondering if I should make a master blueprint for the weapons which would have the pick up logic or if I should make an actor component and add it to each weapon?

All depends. Will it be single player, only player can keep those weapons.

It its only for player character (and no big crafting systems etc.) then it does not matter much, do what you like.

However if you plan multiple characters with same weapons/ blueprints watch for hard references. It is easy to make for eg. weapon that references some bullet that references material, then another weapon etc. This can make network of references and even single weapon in level will load them all.

To avoid referencing all around make generic weapon component (or actor) that does not reference anything outside. Then use data tables or data assets to load visuals into actor/component (or use soft references).

Or look into Lyra how they made it there (yes kind of complicated, but there are tutorials about how it all works and is coded, you can get idea from it).