Skip to content

Commit b156f9d

Browse files
Merge pull request #8 from arenadeveloper02/fix/biome-check
Fix/biome check
2 parents 0f5798b + bbaa41a commit b156f9d

19 files changed

Lines changed: 108 additions & 57 deletions

File tree

apps/sim/app/(auth)/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ export default function AuthLayout({ children }: { children: React.ReactNode })
2525
<div className='mx-auto max-w-7xl'>
2626
<Link href='/' className='inline-flex'>
2727
{brand.logoUrl ? (
28-
<img
28+
<Image
2929
src={brand.logoUrl}
3030
alt={`${brand.name} Logo`}
3131
width={42}
3232
height={42}
3333
className='h-[53px] w-[49px] object-contain'
34+
unoptimized
3435
/>
3536
) : (
3637
<Image src='/sim.svg' alt={`${brand.name} Logo`} width={56} height={56} />

apps/sim/app/(landing)/components/nav-client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default function NavClient({
202202
<div className='inline-block'>
203203
<Link href='/' className='inline-flex'>
204204
{brand.logoUrl ? (
205-
<img
205+
<Image
206206
src={brand.logoUrl}
207207
alt={`${brand.name} Logo`}
208208
width={42}

apps/sim/app/(landing)/components/sections/testimonials.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { motion } from 'framer-motion'
4+
import Image from 'next/image'
45
import { getAssetUrl } from '@/lib/utils'
56
import useIsMobile from '@/app/(landing)/components/hooks/use-is-mobile'
67
import { Marquee } from '@/app/(landing)/components/magicui/marquee'
@@ -124,10 +125,12 @@ function Testimonials() {
124125
<div className='mt-auto flex items-center justify-between'>
125126
<div className='flex items-center gap-1.5 sm:gap-2'>
126127
{card.profileImage && (
127-
<img
128+
<Image
128129
src={card.profileImage}
129130
alt={`${card.username} profile`}
130131
className='h-6 w-6 rounded-full border border-[#333] object-cover sm:h-8 sm:w-8'
132+
width={32}
133+
height={32}
131134
/>
132135
)}
133136
<div className='flex items-center'>
@@ -165,10 +168,12 @@ function Testimonials() {
165168
<div className='mt-auto flex items-center justify-between'>
166169
<div className='flex items-center gap-1.5 sm:gap-2'>
167170
{card.profileImage && (
168-
<img
171+
<Image
169172
src={card.profileImage}
170173
alt={`${card.username} profile`}
171174
className='h-6 w-6 rounded-full border border-[#333] object-cover sm:h-8 sm:w-8'
175+
width={32}
176+
height={32}
172177
/>
173178
)}
174179
<div className='flex items-center'>

apps/sim/app/chat/[subdomain]/components/components/markdown-renderer/markdown-renderer.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,24 @@ export default function MarkdownRenderer({ content }: { content: string }) {
129129
),
130130

131131
// Images
132-
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
133-
<img
134-
src={src}
135-
alt={alt || 'Image'}
136-
className='my-2 h-auto max-w-full rounded-md'
137-
{...props}
138-
/>
139-
),
132+
img: ({ src = '', alt = 'Image', ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => {
133+
// Import Next.js Image component
134+
// @ts-ignore
135+
const Image = require('next/image').default
136+
return (
137+
<div className='my-2 h-auto max-w-full rounded-md'>
138+
<Image
139+
src={src}
140+
alt={alt}
141+
layout='responsive'
142+
width={600}
143+
height={400}
144+
style={{ borderRadius: '0.375rem' }}
145+
{...props}
146+
/>
147+
</div>
148+
)
149+
},
140150
}
141151

142152
// Process text to clean up unnecessary whitespace and formatting issues

apps/sim/app/chat/[subdomain]/components/header/header.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client'
22

3+
import Image from 'next/image'
34
import { GithubIcon } from '@/components/icons'
45

56
interface ChatHeaderProps {
@@ -22,13 +23,15 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) {
2223
return (
2324
<div className='flex items-center justify-between bg-background/95 px-6 py-4 pt-6 backdrop-blur supports-[backdrop-filter]:bg-background/60 md:px-8 md:pt-4'>
2425
<div className='flex items-center gap-4'>
25-
{customImage && (
26-
<img
27-
src={customImage}
28-
alt={`${chatConfig?.title || 'Chat'} logo`}
29-
className='h-8 w-8 rounded-md object-cover'
30-
/>
31-
)}
26+
<Image
27+
src={customImage || '/default-logo.png'}
28+
alt={`${chatConfig?.title || 'Chat'} logo`}
29+
width={32}
30+
height={32}
31+
className='h-8 w-8 rounded-md object-cover'
32+
style={{ objectFit: 'cover' }}
33+
unoptimized
34+
/>
3235
<h2 className='font-medium text-foreground text-lg'>
3336
{chatConfig?.customizations?.headerText || chatConfig?.title || 'Chat'}
3437
</h2>

apps/sim/app/chat/[subdomain]/components/message/components/markdown-renderer.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,21 @@ export default function MarkdownRenderer({
197197
),
198198

199199
// Images
200-
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
201-
<img
202-
src={src}
203-
alt={alt || 'Image'}
204-
className='my-3 h-auto max-w-full rounded-md'
205-
{...props}
206-
/>
207-
),
200+
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => {
201+
// Import Next.js Image component
202+
// @ts-ignore
203+
const Image = require('next/image').default
204+
return (
205+
<Image
206+
src={src || ''}
207+
alt={alt || 'Image'}
208+
className='my-3 h-auto max-w-full rounded-md'
209+
width={props.width ? Number(props.width) : 600}
210+
height={props.height ? Number(props.height) : 400}
211+
{...props}
212+
/>
213+
)
214+
},
208215
}
209216

210217
// Pre-process content to fix common issues

apps/sim/app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
--gradient-secondary: 336 95% 65%; /* More vibrant pink */
9797

9898
/* Brand Colors (Default Sim Theme) */
99-
--brand-primary-hex: #1a73e8; /* Primary brand purple */
99+
--brand-primary-hex: #1a73e8; /* Primary brand purple */
100100
--brand-primary-hover-hex: #155cba; /* Primary brand purple hover */
101101
--brand-secondary-hex: #488fed; /* Secondary brand purple */
102102
--brand-accent-hex: #76abf1; /* Accent purple for links */

apps/sim/app/workspace/[workspaceId]/logs/components/sidebar/components/markdown-renderer.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,22 @@ export default function LogMarkdownRenderer({ content }: { content: string }) {
186186
),
187187

188188
// Images
189-
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
190-
<img src={src} alt={alt || 'Image'} className='my-3 h-auto max-w-full rounded' {...props} />
191-
),
189+
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => {
190+
// Dynamically import Next.js Image to avoid SSR issues
191+
const Image = require('next/image').default
192+
return (
193+
<div className='my-3 h-auto max-w-full overflow-hidden rounded'>
194+
<Image
195+
src={src || ''}
196+
alt={alt || 'Image'}
197+
layout='responsive'
198+
width={400}
199+
height={300}
200+
{...props}
201+
/>
202+
</div>
203+
)
204+
},
192205
}
193206

194207
return (

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/image-selector/image-selector.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use client'
22

33
import { useRef, useState } from 'react'
4-
import { Image, Loader2, Upload, X } from 'lucide-react'
4+
import { Loader2, Image as LucideImage, Upload, X } from 'lucide-react'
5+
import Image from 'next/image'
56
import { Button } from '@/components/ui/button'
67
import { Label } from '@/components/ui/label'
78
import { createLogger } from '@/lib/logs/console/logger'
@@ -193,10 +194,13 @@ export function ImageSelector({
193194
// Show uploaded image
194195
<div className='space-y-2'>
195196
<div className='relative inline-block'>
196-
<img
197+
<Image
197198
src={value}
198199
alt='Uploaded logo'
200+
width={80}
201+
height={80}
199202
className='h-20 w-20 rounded-lg border object-cover'
203+
style={{ objectFit: 'cover' }}
200204
/>
201205
<Button
202206
type='button'
@@ -260,7 +264,7 @@ export function ImageSelector({
260264
</div>
261265
) : (
262266
<div className='space-y-2'>
263-
<Image className='mx-auto h-8 w-8 text-muted-foreground' />
267+
<LucideImage className='mx-auto h-8 w-8 text-muted-foreground' />
264268
<div>
265269
<p className='font-medium text-sm'>
266270
{isDragging ? 'Drop image here!' : placeholder}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/markdown-renderer.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import React, { useEffect, useMemo, useState } from 'react'
44
import { Check, Copy } from 'lucide-react'
5+
import Image from 'next/image'
56
import ReactMarkdown from 'react-markdown'
67
import remarkGfm from 'remark-gfm'
78
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
@@ -365,12 +366,13 @@ export default function CopilotMarkdownRenderer({ content }: CopilotMarkdownRend
365366
{children}
366367
</td>
367368
),
368-
369369
// Images
370-
img: ({ src, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
371-
<img
372-
src={src}
370+
img: ({ src, alt, width, height, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
371+
<Image
372+
src={typeof src === 'string' ? src : ''}
373373
alt={alt || 'Image'}
374+
width={typeof width === 'string' ? Number(width) || 400 : width || 400}
375+
height={typeof height === 'string' ? Number(height) || 300 : height || 300}
374376
className='my-3 h-auto max-w-full rounded-md'
375377
{...props}
376378
/>

0 commit comments

Comments
 (0)