Skip to content

Commit 51bcdfe

Browse files
committed
feat: add tooltips for buttons
1 parent d99fcde commit 51bcdfe

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

chat/src/components/message-input.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -261,22 +261,25 @@ export default function MessageInput({
261261
</TabsList>
262262

263263
<div className={"flex flex-row gap-3"}>
264-
<Button
265-
type="submit"
266-
size="icon"
267-
className="rounded-full"
268-
onClick={handleUploadClick}
264+
{serverStatus !== "running" && <Button
265+
type="submit"
266+
size="icon"
267+
className="rounded-full"
268+
onClick={handleUploadClick}
269+
title={"Upload File"}
269270
>
270-
<Upload/>
271-
<span className="sr-only">Upload</span>
271+
<Upload/>
272+
<span className="sr-only">Upload</span>
272273
</Button>
274+
}
273275

274276
{inputMode === "text" && serverStatus !== "running" && (
275277
<Button
276278
type="submit"
277279
disabled={disabled || !message.trim()}
278280
size="icon"
279281
className="rounded-full"
282+
title={"Send Message"}
280283
>
281284
<SendIcon/>
282285
<span className="sr-only">Send</span>
@@ -291,6 +294,7 @@ export default function MessageInput({
291294
onClick={() => {
292295
onSendMessage(specialKeys.Escape, "raw");
293296
}}
297+
title={"Interrupt"}
294298
>
295299
<Square/>
296300
<span className="sr-only">Stop</span>
@@ -332,20 +336,20 @@ export default function MessageInput({
332336
);
333337
}
334338

335-
function Char({ char }: { char: string }) {
339+
function Char({char}: { char: string }) {
336340
switch (char) {
337341
case "ArrowUp":
338-
return <ArrowUpIcon className="h-4 w-4" />;
342+
return <ArrowUpIcon className="h-4 w-4"/>;
339343
case "ArrowDown":
340-
return <ArrowDownIcon className="h-4 w-4" />;
344+
return <ArrowDownIcon className="h-4 w-4"/>;
341345
case "ArrowRight":
342-
return <ArrowRightIcon className="h-4 w-4" />;
346+
return <ArrowRightIcon className="h-4 w-4"/>;
343347
case "ArrowLeft":
344-
return <ArrowLeftIcon className="h-4 w-4" />;
348+
return <ArrowLeftIcon className="h-4 w-4"/>;
345349
case "⏎":
346-
return <CornerDownLeftIcon className="h-4 w-4" />;
350+
return <CornerDownLeftIcon className="h-4 w-4"/>;
347351
case "Backspace":
348-
return <DeleteIcon className="h-4 w-4" />;
352+
return <DeleteIcon className="h-4 w-4"/>;
349353
default:
350354
return char;
351355
}

0 commit comments

Comments
 (0)