mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
- Introduced a new `CommandsSection` component to manage both development and test commands, replacing the previous `DevServerSection` and `TestingSection`. - Updated the `SettingsService` to handle special cases for `devCommand` and `testCommand`, allowing for null values to delete commands. - Removed deprecated sections and streamlined the project settings view to enhance user experience and maintainability. This refactor simplifies command management and improves the overall structure of the project settings interface.
30 lines
618 B
TypeScript
30 lines
618 B
TypeScript
import { useState, useCallback } from 'react';
|
|
|
|
export type ProjectSettingsViewId =
|
|
| 'identity'
|
|
| 'theme'
|
|
| 'worktrees'
|
|
| 'commands'
|
|
| 'claude'
|
|
| 'data'
|
|
| 'danger';
|
|
|
|
interface UseProjectSettingsViewOptions {
|
|
initialView?: ProjectSettingsViewId;
|
|
}
|
|
|
|
export function useProjectSettingsView({
|
|
initialView = 'identity',
|
|
}: UseProjectSettingsViewOptions = {}) {
|
|
const [activeView, setActiveView] = useState<ProjectSettingsViewId>(initialView);
|
|
|
|
const navigateTo = useCallback((viewId: ProjectSettingsViewId) => {
|
|
setActiveView(viewId);
|
|
}, []);
|
|
|
|
return {
|
|
activeView,
|
|
navigateTo,
|
|
};
|
|
}
|