-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
535 additions
and
512 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { ReactElement } from 'react'; | ||
import { Cog6ToothIcon, PlusCircleIcon } from '@heroicons/react/20/solid'; | ||
|
||
interface ButtonProps { | ||
buttonType?: 'primary' | 'secondary'; | ||
onClick?: () => void; | ||
buttonText: string; | ||
icon?: any; | ||
} | ||
|
||
const Button = ({ | ||
buttonType, | ||
onClick, | ||
buttonText, | ||
icon: Icon, | ||
}: ButtonProps): ReactElement => { | ||
let buttonClassName = | ||
'inline-flex items-center gap-x-2 rounded-md px-3.5 py-2.5 text-sm font-semibold shadow-sm w-full mb-8'; | ||
|
||
if (buttonType === 'primary') { | ||
buttonClassName += | ||
' bg-indigo-600 text-white hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600'; | ||
} else if (buttonType === 'secondary') { | ||
buttonClassName += | ||
' bg-gray-800 text-gray-400 hover:bg-gray-800 hover:text-white'; | ||
} | ||
|
||
return ( | ||
<button type="button" className={buttonClassName} onClick={onClick}> | ||
{Icon && <Icon className="h-5 w-5" />} | ||
{buttonText} | ||
</button> | ||
); | ||
}; | ||
|
||
export default Button; |
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,52 @@ | ||
import React from 'react'; | ||
import { Bars3Icon } from '@heroicons/react/24/outline'; | ||
import ProfileDropdown from '../other/ProfileDropdown'; | ||
import { signOut } from 'next-auth/react'; | ||
|
||
interface HeaderProps { | ||
setSidebarOpen: React.Dispatch<React.SetStateAction<boolean>>; | ||
userImage: string; | ||
userName: string; | ||
} | ||
|
||
const Header: React.FC<HeaderProps> = ({ | ||
setSidebarOpen, | ||
userImage, | ||
userName, | ||
}) => { | ||
const defaultUserImage = '/images/user.png'; | ||
const defaultUserName = 'User'; | ||
|
||
return ( | ||
<div className="sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-800 bg-gray-900 px-4 shadow-sm sm:gap-x-6 sm:px-6 lg:px-8"> | ||
<button | ||
type="button" | ||
className="-m-2.5 p-2.5 text-gray-700 lg:hidden" | ||
onClick={() => setSidebarOpen(true)} | ||
> | ||
<span className="sr-only">Open sidebar</span> | ||
<Bars3Icon className="h-6 w-6" aria-hidden="true" /> | ||
</button> | ||
|
||
<div className="flex flex-1 gap-x-4 self-stretch lg:gap-x-6 items-center"> | ||
<span className="w-full text-center items-center rounded-md bg-blue-400/10 px-2 py-1 text-xs sm:text-sm md:text-md md:text-lg font-medium text-blue-400 ring-1 ring-inset ring-pink-blue/30"> | ||
DOC CHATBOT | ||
</span> | ||
|
||
<div className="flex items-center gap-x-4 lg:gap-x-6"> | ||
<div | ||
className="hidden lg:block lg:h-6 lg:w-px lg:bg-gray-900/10" | ||
aria-hidden="true" | ||
/> | ||
<ProfileDropdown | ||
userImage={userImage || defaultUserImage} | ||
userName={userName || defaultUserName} | ||
signOut={signOut} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |
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,30 @@ | ||
import React from 'react'; | ||
|
||
interface EmptyStateProps { | ||
nameSpaceHasChats: boolean; | ||
selectedNamespace: string; | ||
} | ||
|
||
const EmptyState: React.FC<EmptyStateProps> = ({ | ||
nameSpaceHasChats, | ||
selectedNamespace, | ||
}) => { | ||
const noChatsMessage = !nameSpaceHasChats | ||
? 'You have no chats in this namespace. Create a new chat to get started.' | ||
: 'You have no chats. Create a new chat to get started.'; | ||
|
||
const selectNamespaceMessage = 'Select a namespace to display chats'; | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-center align-center h-screen px-4"> | ||
<h1 className="text-xl md:text-3xl text-center font-semibold text-gray-100"> | ||
Welcome to doc-chatbot | ||
</h1> | ||
<p className="text-md md:text-xl text-center text-gray-100 mt-4"> | ||
{selectedNamespace ? noChatsMessage : selectNamespaceMessage} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EmptyState; |
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
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.