feat: add better provider support, icons, regen, and a lot more
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import type { Entity } from '@triplit/client';
|
||||
import type schema from '#triplit/schema';
|
||||
import ShikiHighlight from '~/components/Markdown/ShikiHighlight.vue';
|
||||
|
||||
defineProps<{
|
||||
error_part: Entity<typeof schema, 'message_parts'>;
|
||||
const props = defineProps<{
|
||||
error: string | null | undefined;
|
||||
}>();
|
||||
|
||||
const code: Ref<string | null> = ref(null);
|
||||
|
||||
if (props.error !== null && props.error !== undefined) {
|
||||
try {
|
||||
code.value = JSON.stringify(JSON.parse(props.error!), null, 2);
|
||||
} catch (e) {
|
||||
code.value = props.error;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<span class="text-sm text-[var(--color-error)]">Generation failed</span>
|
||||
<div class="text-sm">
|
||||
<ShikiHighlight :code="code ?? 'An unknown error occurred'" lang="json" />
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user