mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-22 09:12:44 +00:00
Plugins can transform live timeline source items at render time, append durable plugin rows from daemon handlers, and register client-only slash commands in the composer. Related to #3940 and #3952.
22 lines
733 B
TypeScript
22 lines
733 B
TypeScript
import type { PluginTimelineItemProps } from "@getpaseo/plugin";
|
|
import { useRevealedText } from "@getpaseo/plugin/react-native";
|
|
import { useMemo } from "react";
|
|
import { Text } from "react-native";
|
|
import { z } from "zod";
|
|
|
|
export const inlineThinkingSchema = z.object({
|
|
text: z.string(),
|
|
phase: z.enum(["streaming", "complete"]),
|
|
});
|
|
|
|
type InlineThinkingData = z.output<typeof inlineThinkingSchema>;
|
|
|
|
export function InlineThinking({ item, theme }: PluginTimelineItemProps<InlineThinkingData>) {
|
|
const text = useRevealedText(item.data.text, item.data.phase);
|
|
const style = useMemo(
|
|
() => ({ color: theme.colors.foregroundMuted }),
|
|
[theme.colors.foregroundMuted],
|
|
);
|
|
return <Text style={style}>{text}</Text>;
|
|
}
|