forked from op7418/CodePilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlashCommandButton.tsx
More file actions
32 lines (28 loc) · 844 Bytes
/
SlashCommandButton.tsx
File metadata and controls
32 lines (28 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use client';
import { useTranslation } from '@/hooks/useTranslation';
import type { TranslationKey } from '@/i18n';
import { Lightning } from '@/components/ui/icon';
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from '@/components/ui/tooltip';
import { PromptInputButton } from '@/components/ai-elements/prompt-input';
interface SlashCommandButtonProps {
onInsertSlash: () => void;
}
export function SlashCommandButton({ onInsertSlash }: SlashCommandButtonProps) {
const { t } = useTranslation();
return (
<Tooltip>
<TooltipTrigger asChild>
<PromptInputButton onClick={onInsertSlash}>
<Lightning size={16} />
</PromptInputButton>
</TooltipTrigger>
<TooltipContent>
{t('composer.slashCommandTooltip' as TranslationKey)}
</TooltipContent>
</Tooltip>
);
}