mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-18 15:39:47 +02:00
26 lines
790 B
TypeScript
26 lines
790 B
TypeScript
import { createContext, useContext, type ReactNode } from "react";
|
|
|
|
export type TaskChatPresentationMode = "production" | "streamlined";
|
|
|
|
// Isolated component previews/tests render the new presentation by default.
|
|
// The live TaskChatThread always provides an explicit instance-setting mode.
|
|
const TaskChatPresentationContext = createContext<TaskChatPresentationMode>("streamlined");
|
|
|
|
export function TaskChatPresentationProvider({
|
|
mode,
|
|
children,
|
|
}: {
|
|
mode: TaskChatPresentationMode;
|
|
children: ReactNode;
|
|
}) {
|
|
return (
|
|
<TaskChatPresentationContext.Provider value={mode}>
|
|
{children}
|
|
</TaskChatPresentationContext.Provider>
|
|
);
|
|
}
|
|
|
|
export function useStreamlinedTaskChatPresentation(): boolean {
|
|
return useContext(TaskChatPresentationContext) === "streamlined";
|
|
}
|