Async function to generate components