Skip to content

Commit 78e3d84

Browse files
committed
updated document icon
1 parent 09af6fb commit 78e3d84

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed

apps/sim/app/workspace/[workspaceId]/knowledge/components/icons/document-icons.tsx

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,65 @@ export function VideoIcon(props: SVGProps<SVGSVGElement>) {
139139
)
140140
}
141141

142+
export function HtmlIcon(props: SVGProps<SVGSVGElement>) {
143+
return (
144+
<svg
145+
viewBox='0 0 24 24'
146+
fill='none'
147+
stroke='currentColor'
148+
strokeWidth='1.5'
149+
strokeLinecap='round'
150+
strokeLinejoin='round'
151+
xmlns='http://www.w3.org/2000/svg'
152+
{...props}
153+
>
154+
<path d='M8 8l-4 4 4 4' />
155+
<path d='M16 8l4 4-4 4' />
156+
<line x1='14' y1='4' x2='10' y2='20' />
157+
</svg>
158+
)
159+
}
160+
161+
export function JsonIcon(props: SVGProps<SVGSVGElement>) {
162+
return (
163+
<svg
164+
viewBox='0 0 24 24'
165+
fill='none'
166+
stroke='currentColor'
167+
strokeWidth='1.5'
168+
strokeLinecap='round'
169+
strokeLinejoin='round'
170+
xmlns='http://www.w3.org/2000/svg'
171+
{...props}
172+
>
173+
<path d='M8 3H7a2 2 0 0 0-2 2v4c0 1.1-.9 2-2 2 1.1 0 2 .9 2 2v4a2 2 0 0 0 2 2h1' />
174+
<path d='M16 3h1a2 2 0 0 1 2 2v4c0 1.1.9 2 2 2-1.1 0-2 .9-2 2v4a2 2 0 0 1-2 2h-1' />
175+
</svg>
176+
)
177+
}
178+
179+
export function MarkdownIcon(props: SVGProps<SVGSVGElement>) {
180+
return (
181+
<svg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' {...props}>
182+
<rect x='2' y='4' width='20' height='16' rx='3' stroke='currentColor' strokeWidth='1.5' />
183+
<path
184+
d='M6 15V9l3 3.5L12 9v6'
185+
stroke='currentColor'
186+
strokeWidth='1.5'
187+
strokeLinecap='round'
188+
strokeLinejoin='round'
189+
/>
190+
<path
191+
d='M17 9v6m-2-2l2 2 2-2'
192+
stroke='currentColor'
193+
strokeWidth='1.5'
194+
strokeLinecap='round'
195+
strokeLinejoin='round'
196+
/>
197+
</svg>
198+
)
199+
}
200+
142201
export function DefaultFileIcon(props: SVGProps<SVGSVGElement>) {
143202
return (
144203
<svg
@@ -218,5 +277,17 @@ export function getDocumentIcon(
218277
return PptxIcon
219278
}
220279

280+
if (mimeType === 'text/html' || extension === 'html' || extension === 'htm') {
281+
return HtmlIcon
282+
}
283+
284+
if (mimeType === 'application/json' || extension === 'json') {
285+
return JsonIcon
286+
}
287+
288+
if (mimeType === 'text/markdown' || extension === 'md' || extension === 'mdx') {
289+
return MarkdownIcon
290+
}
291+
221292
return DefaultFileIcon
222293
}

apps/sim/components/icons/document-icons.tsx

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,65 @@ export function VideoIcon(props: SVGProps<SVGSVGElement>) {
139139
)
140140
}
141141

142+
export function HtmlIcon(props: SVGProps<SVGSVGElement>) {
143+
return (
144+
<svg
145+
viewBox='0 0 24 24'
146+
fill='none'
147+
stroke='currentColor'
148+
strokeWidth='1.5'
149+
strokeLinecap='round'
150+
strokeLinejoin='round'
151+
xmlns='http://www.w3.org/2000/svg'
152+
{...props}
153+
>
154+
<path d='M8 8l-4 4 4 4' />
155+
<path d='M16 8l4 4-4 4' />
156+
<line x1='14' y1='4' x2='10' y2='20' />
157+
</svg>
158+
)
159+
}
160+
161+
export function JsonIcon(props: SVGProps<SVGSVGElement>) {
162+
return (
163+
<svg
164+
viewBox='0 0 24 24'
165+
fill='none'
166+
stroke='currentColor'
167+
strokeWidth='1.5'
168+
strokeLinecap='round'
169+
strokeLinejoin='round'
170+
xmlns='http://www.w3.org/2000/svg'
171+
{...props}
172+
>
173+
<path d='M8 3H7a2 2 0 0 0-2 2v4c0 1.1-.9 2-2 2 1.1 0 2 .9 2 2v4a2 2 0 0 0 2 2h1' />
174+
<path d='M16 3h1a2 2 0 0 1 2 2v4c0 1.1.9 2 2 2-1.1 0-2 .9-2 2v4a2 2 0 0 1-2 2h-1' />
175+
</svg>
176+
)
177+
}
178+
179+
export function MarkdownIcon(props: SVGProps<SVGSVGElement>) {
180+
return (
181+
<svg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' {...props}>
182+
<rect x='2' y='4' width='20' height='16' rx='3' stroke='currentColor' strokeWidth='1.5' />
183+
<path
184+
d='M6 15V9l3 3.5L12 9v6'
185+
stroke='currentColor'
186+
strokeWidth='1.5'
187+
strokeLinecap='round'
188+
strokeLinejoin='round'
189+
/>
190+
<path
191+
d='M17 9v6m-2-2l2 2 2-2'
192+
stroke='currentColor'
193+
strokeWidth='1.5'
194+
strokeLinecap='round'
195+
strokeLinejoin='round'
196+
/>
197+
</svg>
198+
)
199+
}
200+
142201
export function DefaultFileIcon(props: SVGProps<SVGSVGElement>) {
143202
return (
144203
<svg
@@ -218,5 +277,17 @@ export function getDocumentIcon(
218277
return PptxIcon
219278
}
220279

280+
if (mimeType === 'text/html' || extension === 'html' || extension === 'htm') {
281+
return HtmlIcon
282+
}
283+
284+
if (mimeType === 'application/json' || extension === 'json') {
285+
return JsonIcon
286+
}
287+
288+
if (mimeType === 'text/markdown' || extension === 'md' || extension === 'mdx') {
289+
return MarkdownIcon
290+
}
291+
221292
return DefaultFileIcon
222293
}

0 commit comments

Comments
 (0)