/** * Settings › Version Control › GitHub (`GithubSettingsConfigurable`): per-project GitHub CLI * account selection (`vcs.github.account`) and pull request review options. Applies at once, * like the Log page. */ import { useEffect, useId } from "react"; import { tx } from "@/platform/i18n"; import { Button, Checkbox, Select, T } from "@/ui"; import { loadProjectGithubAccount, projectAccountOptions, setProjectGithubAccount, useGhProjectAccount, } from "../data/account"; import { setReviewDiffSettings, useReviewDiffSettings } from "./settings"; import styles from "./ReviewDiff.module.css"; export function GithubSettingsPage() { const autoMarkViewed = useReviewDiffSettings((s) => s.autoMarkViewed); const status = useGhProjectAccount((s) => s.status); const saving = useGhProjectAccount((s) => s.saving); const accountHeading = useId(); const prHeading = useId(); const selectId = useId(); useEffect(() => { void loadProjectGithubAccount(); }, []); const options = projectAccountOptions(status); const value = status?.configuredAccount ?? ""; const suggested = !value ? (status?.suggestedAccount ?? null) : null; return (
{value ? (