updated js component snippet