President-elect Donald Trump has named Pam Bondi, the former attorney general of Florida, to be US attorney general just hours after Matt Gaetz withdrew his name from consideration.