better createFile

This commit is contained in:
Nate 2024-11-28 20:24:18 -08:00
parent 5659afc96f
commit 54b7b22e3f

View file

@ -7,11 +7,9 @@ interface CreateFileToolCallProps {
}
export function CreateFile(props: CreateFileToolCallProps) {
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.filepath ?? "javascript")} ${props.filepath}\n${props.fileContents ?? ""}\n\`\`\``;
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.filepath ?? "test.txt")} ${props.filepath}\n${props.fileContents ?? ""}\n\`\`\``;
return (
<>
<StyledMarkdownPreview isRenderingInStepContainer={true} source={src} />
</>
);
return props.filepath ? (
<StyledMarkdownPreview isRenderingInStepContainer={true} source={src} />
) : null;
}