And null handling for response output_files in code output

This commit is contained in:
sabaimran 2024-11-11 21:14:56 -08:00
parent d68243a3fb
commit d7027109a5

View file

@ -220,7 +220,8 @@ function CodeContextReferenceCard(props: CodeContextReferenceCardProps) {
>
{sanitizedCodeSnippet}
</pre>
{renderOutputFiles(props.output_files, false)}
{props.output_files?.length > 0 &&
renderOutputFiles(props.output_files, false)}
</div>
</Card>
</PopoverTrigger>
@ -236,7 +237,7 @@ function CodeContextReferenceCard(props: CodeContextReferenceCardProps) {
code {props.output_files?.length > 0 ? "artifact" : ""}
</h3>
</div>
{(props.output_files.length > 0 &&
{(props.output_files?.length > 0 &&
renderOutputFiles(props.output_files?.slice(0, 1), true)) || (
<pre className="text-xs border-t mt-1 pt-1 verflow-hidden line-clamp-10">
{sanitizedCodeSnippet}