-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: drag n drop files + refactor markdown (#550)
* wip * fix: markdown pre, code elements * fixes * fixes * refactor * remove uiw markdown dependency * fixes * fixes * fixes * feat: drag n drop files in textarea box * fix: npm audit
- Loading branch information
1 parent
8f4bc32
commit 9d9954c
Showing
12 changed files
with
10,403 additions
and
7,409 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
48 changes: 48 additions & 0 deletions
48
apps/shinkai-desktop/src/components/chat/chat-action-bar/file-selection-action-bar.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,48 @@ | ||
import { useTranslation } from '@shinkai_network/shinkai-i18n'; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipPortal, | ||
TooltipTrigger, | ||
} from '@shinkai_network/shinkai-ui'; | ||
import { cn } from '@shinkai_network/shinkai-ui/utils'; | ||
import { Paperclip } from 'lucide-react'; | ||
import * as React from 'react'; | ||
|
||
import { allowedFileExtensions } from '../../../lib/constants'; | ||
import { actionButtonClassnames } from '../conversation-footer'; | ||
|
||
type FileUploadInputProps = { | ||
inputProps: React.InputHTMLAttributes<HTMLInputElement>; | ||
onClick: () => void; | ||
}; | ||
|
||
export function FileSelectionActionBar({ | ||
onClick, | ||
inputProps, | ||
}: FileUploadInputProps) { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<button | ||
className={cn(actionButtonClassnames)} | ||
onClick={onClick} | ||
type="button" | ||
> | ||
<Paperclip className="h-full w-full" /> | ||
</button> | ||
</TooltipTrigger> | ||
<TooltipPortal> | ||
<TooltipContent align="center" side="top"> | ||
{t('common.uploadFile')} <br /> | ||
{allowedFileExtensions.join(', ')} | ||
</TooltipContent> | ||
</TooltipPortal> | ||
</Tooltip> | ||
<input {...inputProps} /> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.