Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
612 B
Raw Blame
"use client";

import { useMemo } from "react";
import { useCurrentWorkspace } from "../paths";
import { deriveGitHubSettings, type GitHubSettings } from "./settings";

/**
 * Reads the GitHub feature flags off the current workspace's settings JSONB.
 * Components downstream should consult this hook rather than poking at
 * `workspace.settings` directly, so the per-flag fallback semantics
 * (see deriveGitHubSettings) stay consistent.
 */
export function useGitHubSettings(): GitHubSettings {
  const workspace = useCurrentWorkspace();
  return useMemo(() => deriveGitHubSettings(workspace), [workspace]);
}