-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: split out chat actions into their own files
- Loading branch information
1 parent
5fdabc4
commit bfebd0e
Showing
5 changed files
with
251 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { PaperclipIcon } from "lucide-react"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "~/components/ui/tooltip"; | ||
|
||
export function FilesInfo() { | ||
return ( | ||
<Tooltip> | ||
<TooltipContent>Files (Coming Soon)</TooltipContent> | ||
|
||
<TooltipTrigger asChild> | ||
<div> | ||
<Button | ||
size="icon-sm" | ||
variant="outline" | ||
className="gap-2" | ||
startContent={<PaperclipIcon />} | ||
disabled | ||
/> | ||
</div> | ||
</TooltipTrigger> | ||
</Tooltip> | ||
); | ||
} |
63 changes: 63 additions & 0 deletions
63
ui/admin/app/components/chat/chat-actions/KnowledgeInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { LibraryIcon } from "lucide-react"; | ||
|
||
import { KnowledgeFile } from "~/lib/model/knowledge"; | ||
import { cn } from "~/lib/utils"; | ||
|
||
import { TypographyMuted } from "~/components/Typography"; | ||
import { Button } from "~/components/ui/button"; | ||
import { | ||
Popover, | ||
PopoverContent, | ||
PopoverTrigger, | ||
} from "~/components/ui/popover"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "~/components/ui/tooltip"; | ||
|
||
export function KnowledgeInfo({ | ||
knowledge, | ||
className, | ||
disabled, | ||
}: { | ||
knowledge: KnowledgeFile[]; | ||
className?: string; | ||
disabled?: boolean; | ||
}) { | ||
return ( | ||
<Tooltip> | ||
<TooltipContent>Knowledge</TooltipContent> | ||
|
||
<Popover> | ||
<TooltipTrigger asChild> | ||
<PopoverTrigger asChild> | ||
<Button | ||
size="icon-sm" | ||
variant="outline" | ||
className={cn("gap-2", className)} | ||
startContent={<LibraryIcon />} | ||
disabled={disabled} | ||
/> | ||
</PopoverTrigger> | ||
</TooltipTrigger> | ||
|
||
<PopoverContent> | ||
{knowledge.length > 0 ? ( | ||
<div className="space-y-2"> | ||
{knowledge.map((file) => ( | ||
<TypographyMuted key={file.id}> | ||
{file.fileName} | ||
</TypographyMuted> | ||
))} | ||
</div> | ||
) : ( | ||
<TypographyMuted> | ||
No knowledge available | ||
</TypographyMuted> | ||
)} | ||
</PopoverContent> | ||
</Popover> | ||
</Tooltip> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { TableIcon } from "lucide-react"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "~/components/ui/tooltip"; | ||
|
||
export function TablesInfo() { | ||
return ( | ||
<Tooltip> | ||
<TooltipContent>Tables (Coming Soon)</TooltipContent> | ||
|
||
<TooltipTrigger asChild> | ||
<div> | ||
<Button | ||
size="icon-sm" | ||
variant="outline" | ||
className="gap-2" | ||
startContent={<TableIcon />} | ||
disabled | ||
/> | ||
</div> | ||
</TooltipTrigger> | ||
</Tooltip> | ||
); | ||
} |
Oops, something went wrong.