refactor(store): split gatewayStore into specialized domain stores
Major restructuring: - Split monolithic gatewayStore into 5 focused stores: - connectionStore: WebSocket connection and gateway lifecycle - configStore: quickConfig, workspaceInfo, MCP services - agentStore: clones, usage stats, agent management - handStore: hands, approvals, triggers, hand runs - workflowStore: workflows, workflow runs, execution - Update all components to use new stores with selector pattern - Remove
This commit is contained in:
@@ -8,11 +8,8 @@
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import {
|
||||
useGatewayStore,
|
||||
type Approval,
|
||||
type ApprovalStatus,
|
||||
} from '../store/gatewayStore';
|
||||
import { useHandStore } from '../store/handStore';
|
||||
import type { Approval, ApprovalStatus } from '../store/handStore';
|
||||
import {
|
||||
CheckCircle,
|
||||
XCircle,
|
||||
@@ -297,8 +294,10 @@ function EmptyState({ filter }: { filter: FilterStatus }) {
|
||||
// === Main ApprovalsPanel Component ===
|
||||
|
||||
export function ApprovalsPanel() {
|
||||
const { approvals, loadApprovals, respondToApproval, isLoading } =
|
||||
useGatewayStore();
|
||||
const approvals = useHandStore((s) => s.approvals);
|
||||
const loadApprovals = useHandStore((s) => s.loadApprovals);
|
||||
const respondToApproval = useHandStore((s) => s.respondToApproval);
|
||||
const isLoading = useHandStore((s) => s.isLoading);
|
||||
const [filter, setFilter] = useState<FilterStatus>('all');
|
||||
const [processingId, setProcessingId] = useState<string | null>(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user