Open History to see the last commit
1import { EnvironmentId } from "@t3tools/contracts";
2
3import { ProjectSettingsPanel } from "./ProjectSettingsPanel";
4import { useSettingsScope } from "./SettingsScopeContext";
5import { SettingsScopeNotice } from "./SettingsScopeNotice";
6import { SettingsPageContainer } from "./settingsLayout";
7
8export function ProjectsSettings() {
9 const { search: value, scope } = useSettingsScope();
10 const projectScope =
11 scope.kind === "project" ||
12 scope.kind === "checkout" ||
13 (scope.kind === "unavailable" &&
14 (scope.reason === "project-missing" || scope.reason === "checkout-missing"));
15 return (
16 <div className="flex min-h-0 flex-1 flex-col">
17 {value.project && projectScope ? (
18 <ProjectSettingsPanel
19 projectKey={value.project}
20 environmentId={value.machine ? EnvironmentId.make(value.machine) : null}
21 checkoutKey={value.checkout ?? null}
22 />
23 ) : scope.kind === "unavailable" ? (
24 <SettingsPageContainer>
25 <p className="text-sm text-muted-foreground">{scope.message}</p>
26 </SettingsPageContainer>
27 ) : (
28 <SettingsScopeNotice target="project">
29 Choose a project to manage its name, icon, checkouts and actions.
30 </SettingsScopeNotice>
31 )}
32 </div>
33 );
34}