From ff690350b1ac5ec4f415d9d3eabaeb839196fa1c Mon Sep 17 00:00:00 2001
From: Adam <2363879+adamdotdevin@users.noreply.github.com>
Date: Tue, 16 Dec 2025 10:49:22 -0600
Subject: feat(desktop): show write tool output

---
 packages/ui/src/context/diff.tsx | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

(limited to 'packages/ui/src/context/diff.tsx')

diff --git a/packages/ui/src/context/diff.tsx b/packages/ui/src/context/diff.tsx
index 630437de6..747de9cc8 100644
--- a/packages/ui/src/context/diff.tsx
+++ b/packages/ui/src/context/diff.tsx
@@ -1,13 +1,10 @@
-import { createContext, useContext, type ParentProps, type ValidComponent } from "solid-js"
+import type { ValidComponent } from "solid-js"
+import { createSimpleContext } from "./helper"
 
-const DiffComponentContext = createContext<ValidComponent>()
+const ctx = createSimpleContext<ValidComponent, { component: ValidComponent }>({
+  name: "DiffComponent",
+  init: (props) => props.component,
+})
 
-export function DiffComponentProvider(props: ParentProps<{ component: ValidComponent }>) {
-  return <DiffComponentContext.Provider value={props.component}>{props.children}</DiffComponentContext.Provider>
-}
-
-export function useDiffComponent() {
-  const component = useContext(DiffComponentContext)
-  if (!component) throw new Error("DiffComponentProvider must be used to provide a diff component")
-  return component
-}
+export const DiffComponentProvider = ctx.provider
+export const useDiffComponent = ctx.use
-- 
cgit v1.2.3

