I thought after GST was implemented electronic components were charged only 18%.
Yes and No. GST does not replace Customs Duty. Customs Duty is additional and separate. Earlier most electronic goods were exempt from customs duty [or were charged at 0% to 5%. Few around 28%]. As part of make in India initiative, the customs duty rates have been revised ... you would need to consult experts.
In this specific case as the item did not quote specific import classification code, the item was charged at maximum of the category. Ideally the customs officer should have classified this as HS Code: 84733010 [meant for micro processors] that is at 0% customs duty. But charged as cable and socket [??] at the rate of around 23% plus
Additionally there is IGST of 18% on these items take the total rate to 41% plus