// get projects const { ownerId, potId, potDetail } = props; const projects = Near.view(potId, "get_approved_applications", {}); if (!projects) return "Loading..."; const { public_round_start_ms, public_round_end_ms } = potDetail; const now = Date.now(); const publicRoundOpen = now >= public_round_start_ms && now < public_round_end_ms; return ( <Widget src={`${ownerId}/widget/Components.ListSection`} props={{ items: projects, renderItem: (project) => { return ( <Widget src={`${ownerId}/widget/Project.Card`} props={{ ...props, potId, projectId: project.project_id, allowDonate: publicRoundOpen && project.project_id !== context.accountId, // button: ( // <Widget // src={`${ownerId}/widget/Components.Button`} // props={{ // type: "primary", // text: "Donate", // onClick: handleDonate, // }} // /> // ), // TODO: add prop indicating that button should read "Donate" and providing onClick method }} /> ); }, }} /> );