Skip to content

Commit b3e8d8e

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
refactor(emcn): share filled stop icon across chat controls
1 parent b5d17aa commit b3e8d8e

5 files changed

Lines changed: 20 additions & 24 deletions

File tree

apps/sim/app/(interfaces)/chat/components/input/input.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import type React from 'react'
44
import { useLayoutEffect, useRef, useState } from 'react'
55
import { Badge, Button, cn, Tooltip } from '@sim/emcn'
6-
import { ArrowUp, Paperclip, X } from '@sim/emcn/icons'
6+
import { ArrowUp, Paperclip, StopFilled, X } from '@sim/emcn/icons'
77
import { createLogger } from '@sim/logger'
88
import { generateId } from '@sim/utils/id'
99
import { CHAT_ACCEPT_ATTRIBUTE } from '@/lib/uploads/utils/validation'
@@ -258,13 +258,7 @@ export const ChatInput: React.FC<{
258258
className='size-[28px] rounded-full p-0'
259259
aria-label='Stop generation'
260260
>
261-
<svg
262-
className='block size-[14px] fill-current'
263-
viewBox='0 0 24 24'
264-
xmlns='http://www.w3.org/2000/svg'
265-
>
266-
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
267-
</svg>
261+
<StopFilled className='block size-[14px] fill-current' />
268262
</Button>
269263
) : (
270264
<Button

apps/sim/app/o/[organizationId]/home/components/composer/composer.tsx

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

33
import { useRef } from 'react'
44
import { Button, Chip, cn, Tooltip } from '@sim/emcn'
5-
import { ArrowUp, Plus } from '@sim/emcn/icons'
5+
import { ArrowUp, Plus, StopFilled } from '@sim/emcn/icons'
66
import { ASSISTANT_IMAGE_ACCEPT_ATTRIBUTE } from '@/lib/uploads/shared/assistant-images'
77
import { useOrganizationContext } from '@/app/o/[organizationId]/providers/organization-provider'
88
import { AttachedFilesList } from '@/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list/attached-files-list'
@@ -137,13 +137,7 @@ export function Composer({
137137
aria-label='Stop generation'
138138
className={cn(SEND_BUTTON_BASE, SEND_BUTTON_ACTIVE)}
139139
>
140-
<svg
141-
className='block size-[14px] fill-white dark:fill-black'
142-
viewBox='0 0 24 24'
143-
xmlns='http://www.w3.org/2000/svg'
144-
>
145-
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
146-
</svg>
140+
<StopFilled className='block size-[14px] fill-white dark:fill-black' />
147141
</Button>
148142
) : (
149143
<Button

apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/send-button/send-button.tsx

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

33
import React from 'react'
4-
import { ArrowUp, Button, cn } from '@sim/emcn'
4+
import { Button, cn } from '@sim/emcn'
5+
import { ArrowUp, StopFilled } from '@sim/emcn/icons'
56
import {
67
SEND_BUTTON_ACTIVE,
78
SEND_BUTTON_BASE,
@@ -30,13 +31,7 @@ export const SendButton = React.memo(function SendButton({
3031
title='Stop generation'
3132
aria-label='Stop generation'
3233
>
33-
<svg
34-
className='block h-[14px] w-[14px] fill-white dark:fill-black'
35-
viewBox='0 0 24 24'
36-
xmlns='http://www.w3.org/2000/svg'
37-
>
38-
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
39-
</svg>
34+
<StopFilled className='block h-[14px] w-[14px] fill-white dark:fill-black' />
4035
</Button>
4136
)
4237
}

packages/emcn/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export { Split } from './split'
144144
export { Sprout } from './sprout'
145145
export { Square } from './square'
146146
export { SquareArrowUpRight } from './square-arrow-up-right'
147+
export { StopFilled } from './stop-filled'
147148
export { Strikethrough } from './strikethrough'
148149
export { Sun } from './sun'
149150
export { Table } from './table'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { SVGProps } from 'react'
2+
3+
/**
4+
* Filled stop icon. Callers provide the size and fill through SVG props.
5+
*/
6+
export function StopFilled(props: SVGProps<SVGSVGElement>) {
7+
return (
8+
<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' {...props}>
9+
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
10+
</svg>
11+
)
12+
}

0 commit comments

Comments
 (0)