({
workspace,
onEditPrompt,
})
| 763 | }; |
| 764 | |
| 765 | const BuildingWorkspace: FC<BuildingWorkspaceProps> = ({ |
| 766 | workspace, |
| 767 | onEditPrompt, |
| 768 | }) => { |
| 769 | const { data: template } = useQuery( |
| 770 | templateQueryOptions(workspace.template_id), |
| 771 | ); |
| 772 | |
| 773 | const buildLogs = useWorkspaceBuildLogs(workspace.latest_build.id); |
| 774 | |
| 775 | // If no template yet, use an indeterminate progress bar. |
| 776 | const transitionStats = (template && |
| 777 | getActiveTransitionStats(template, workspace)) || { |
| 778 | P50: 0, |
| 779 | P95: null, |
| 780 | }; |
| 781 | |
| 782 | return ( |
| 783 | <section className="p-16 overflow-y-auto"> |
| 784 | <div className="flex justify-center items-center w-full"> |
| 785 | <div className="flex flex-col gap-6 items-center w-full"> |
| 786 | <header className="flex flex-col items-center text-center"> |
| 787 | <h3 className="m-0 font-medium text-content-primary text-xl"> |
| 788 | Starting your workspace |
| 789 | </h3> |
| 790 | <p className="text-content-secondary m-0"> |
| 791 | Your task will be running in a few moments |
| 792 | </p> |
| 793 | </header> |
| 794 | |
| 795 | <div className="w-full max-w-screen-lg flex flex-col gap-4 overflow-hidden"> |
| 796 | <WorkspaceBuildProgress |
| 797 | workspace={workspace} |
| 798 | transitionStats={transitionStats} |
| 799 | variant="task" |
| 800 | /> |
| 801 | |
| 802 | <ScrollArea className="h-96 border border-solid border-border rounded-lg"> |
| 803 | <WorkspaceBuildLogs |
| 804 | sticky |
| 805 | className="border-0 rounded-none" |
| 806 | logs={buildLogs ?? []} |
| 807 | /> |
| 808 | </ScrollArea> |
| 809 | |
| 810 | <div className="flex flex-col items-center gap-3 mt-4"> |
| 811 | <p className="text-content-secondary text-sm m-0 max-w-md text-center"> |
| 812 | You can edit the prompt while we prepare the environment |
| 813 | </p> |
| 814 | <Button size="sm" onClick={onEditPrompt}> |
| 815 | Edit Prompt |
| 816 | </Button> |
| 817 | </div> |
| 818 | </div> |
| 819 | </div> |
| 820 | </div> |
| 821 | </section> |
| 822 | ); |
nothing calls this directly
no test coverage detected