I need the bottom code to work with the top. The top code was originally a component but I changed it to a function but I don\'t know what to do with the bottom code.