Programmer-RD-AI
commited on
Commit
·
5b73d4d
1
Parent(s):
a8aec61
feat: update image handling and environment configuration
Browse files
next.config.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module.exports = {
|
| 2 |
+
env: {
|
| 3 |
+
NEXT_PUBLIC_API_BASE_URL: process.env.NEXT_PUBLIC_API_BASE_URL,
|
| 4 |
+
NEXT_PUBLIC_DEFAULT_ENDPOINT: process.env.NEXT_PUBLIC_DEFAULT_ENDPOINT
|
| 5 |
+
}
|
| 6 |
+
}
|
src/components/ui/typography/MarkdownRenderer/inlineStyles.tsx
CHANGED
|
@@ -159,16 +159,16 @@ const Img = ({ src, alt }: ImgProps) => {
|
|
| 159 |
<div className="flex h-40 flex-col items-center justify-center gap-2 rounded-md bg-secondary/50 text-muted">
|
| 160 |
<Paragraph className="text-primary">Image unavailable</Paragraph>
|
| 161 |
<Link
|
| 162 |
-
href={src}
|
| 163 |
target="_blank"
|
| 164 |
className="max-w-md truncate underline"
|
| 165 |
>
|
| 166 |
-
{src}
|
| 167 |
</Link>
|
| 168 |
</div>
|
| 169 |
) : (
|
| 170 |
<Image
|
| 171 |
-
src={src}
|
| 172 |
width={96}
|
| 173 |
height={56}
|
| 174 |
alt={alt ?? 'Rendered image'}
|
|
|
|
| 159 |
<div className="flex h-40 flex-col items-center justify-center gap-2 rounded-md bg-secondary/50 text-muted">
|
| 160 |
<Paragraph className="text-primary">Image unavailable</Paragraph>
|
| 161 |
<Link
|
| 162 |
+
href={typeof src === 'string' ? src : '#'}
|
| 163 |
target="_blank"
|
| 164 |
className="max-w-md truncate underline"
|
| 165 |
>
|
| 166 |
+
{typeof src === 'string' ? src : 'Invalid source'}
|
| 167 |
</Link>
|
| 168 |
</div>
|
| 169 |
) : (
|
| 170 |
<Image
|
| 171 |
+
src={typeof src === 'string' ? src : ''}
|
| 172 |
width={96}
|
| 173 |
height={56}
|
| 174 |
alt={alt ?? 'Rendered image'}
|
src/components/ui/typography/MarkdownRenderer/styles.tsx
CHANGED
|
@@ -183,16 +183,16 @@ const Img = ({ src, alt }: ImgProps) => {
|
|
| 183 |
<div className="flex h-40 flex-col items-center justify-center gap-2 rounded-md bg-secondary/50 text-muted">
|
| 184 |
<Paragraph className="text-primary">Image unavailable</Paragraph>
|
| 185 |
<Link
|
| 186 |
-
href={src}
|
| 187 |
target="_blank"
|
| 188 |
className="max-w-md truncate underline"
|
| 189 |
>
|
| 190 |
-
{src}
|
| 191 |
</Link>
|
| 192 |
</div>
|
| 193 |
) : (
|
| 194 |
<Image
|
| 195 |
-
src={src}
|
| 196 |
width={1280}
|
| 197 |
height={720}
|
| 198 |
alt={alt ?? 'Rendered image'}
|
|
|
|
| 183 |
<div className="flex h-40 flex-col items-center justify-center gap-2 rounded-md bg-secondary/50 text-muted">
|
| 184 |
<Paragraph className="text-primary">Image unavailable</Paragraph>
|
| 185 |
<Link
|
| 186 |
+
href={typeof src === 'string' ? src : '#'}
|
| 187 |
target="_blank"
|
| 188 |
className="max-w-md truncate underline"
|
| 189 |
>
|
| 190 |
+
{typeof src === 'string' ? src : 'Invalid source'}
|
| 191 |
</Link>
|
| 192 |
</div>
|
| 193 |
) : (
|
| 194 |
<Image
|
| 195 |
+
src={typeof src === 'string' ? src : ''}
|
| 196 |
width={1280}
|
| 197 |
height={720}
|
| 198 |
alt={alt ?? 'Rendered image'}
|
src/store.ts
CHANGED
|
@@ -88,7 +88,8 @@ export const usePlaygroundStore = create<PlaygroundStore>()(
|
|
| 88 |
hasStorage: false,
|
| 89 |
setHasStorage: (hasStorage) => set(() => ({ hasStorage })),
|
| 90 |
chatInputRef: { current: null },
|
| 91 |
-
selectedEndpoint:
|
|
|
|
| 92 |
setSelectedEndpoint: (selectedEndpoint) =>
|
| 93 |
set(() => ({ selectedEndpoint })),
|
| 94 |
agents: [],
|
|
|
|
| 88 |
hasStorage: false,
|
| 89 |
setHasStorage: (hasStorage) => set(() => ({ hasStorage })),
|
| 90 |
chatInputRef: { current: null },
|
| 91 |
+
selectedEndpoint:
|
| 92 |
+
process.env.NEXT_PUBLIC_DEFAULT_ENDPOINT || 'http://localhost:7777',
|
| 93 |
setSelectedEndpoint: (selectedEndpoint) =>
|
| 94 |
set(() => ({ selectedEndpoint })),
|
| 95 |
agents: [],
|