## Azure Resources Created - ACR: socsocacr.azurecr.io (Operation, southeastasia) - Container App Environment: soc-cae (Operation, southeastasia) - Container App: soc-langgraph (Operation, southeastasia, port 2024) - Scale: 0-2 replicas, 0.5 vCPU / 1GB - Registry: socsocacr.azurecr.io (system-assigned managed identity) - OIDC: oidc-msi-8ac6 granted Contributor on Operation resource group ## What's included - Full langgraphjs-gen-ui-examples codebase under langgraph/ - Dockerfile: node:20-slim + pnpm, exposes port 2024 - .dockerignore, .gitignore - GitHub Actions: .github/workflows/deploy-langgraph.yml - Trigger: push to main, paths langgraph/** - Uses az acr build (cloud build, no local Docker needed) - Deploys to soc-langgraph Container App Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
22 lines
743 B
Plaintext
22 lines
743 B
Plaintext
```tsx
|
|
// src/context/TodoContext.tsx
|
|
import React, { createContext, useContext, useReducer } from 'react';
|
|
|
|
type Todo = { id: string; text: string; completed: boolean; };
|
|
|
|
type TodoState = { todos: Todo[]; };
|
|
type TodoAction =
|
|
| { type: 'ADD_TODO'; payload: string }
|
|
| { type: 'TOGGLE_TODO'; payload: string }
|
|
| { type: 'DELETE_TODO'; payload: string };
|
|
|
|
const TodoContext = createContext<{
|
|
state: TodoState;
|
|
dispatch: React.Dispatch<TodoAction>;
|
|
} | undefined>(undefined);
|
|
|
|
export const TodoProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
const [state, dispatch] = useReducer(todoReducer, { todos: [] });
|
|
return <TodoContext.Provider value={{ state, dispatch }}>{children}</TodoContext.Provider>;
|
|
};
|
|
``` |