-
Notifications
You must be signed in to change notification settings - Fork 38
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
1 parent
da93a8f
commit 46e4299
Showing
22 changed files
with
723 additions
and
7,184 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,103 @@ | ||
name: Code Quality | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
pull_request: | ||
branches: [main, develop] | ||
|
||
jobs: | ||
prettier: | ||
name: "Prettier" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
# cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Prettier check | ||
run: npm run prettier | ||
|
||
eslint: | ||
name: "ESLint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
# cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint check | ||
run: npm run lint | ||
|
||
lint-fix: | ||
name: "Fix Lint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
# cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run TypeScript type check | ||
run: npm run lint:fix | ||
|
||
types: | ||
name: "Type Check" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
# cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run TypeScript type check | ||
run: npm run type-check | ||
|
||
find-unused: | ||
name: "Find Unused" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
# cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run TypeScript type check | ||
run: npm run find:unused |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import useTimeFormat from '@/utils/useTimeFormat' | ||
import Image from 'next/image' | ||
import useTimeFormat from "@/utils/useTimeFormat"; | ||
import Image from "next/image"; | ||
|
||
interface UserDetailsProps { | ||
sent: boolean | ||
sent: boolean; | ||
// time: string | ||
} | ||
|
||
const UserDetails = ({ sent }: UserDetailsProps) => { | ||
return ( | ||
<div | ||
className={`flex gap-3 items-center ${sent ? 'flex-row-reverse' : ''}`}> | ||
className={`flex gap-3 items-center ${sent ? "flex-row-reverse" : ""}`} | ||
> | ||
<Image | ||
alt='Krishna' | ||
alt="Krishna" | ||
height={58} | ||
width={58} | ||
className='flex-1 aspect-square h-10 w-10 md:h-14 md:w-14 rounded-full' | ||
src={sent ? '/Avatars/arjuna.png' : '/Avatars/krishna.png'} | ||
className="flex-1 aspect-square h-10 w-10 md:h-14 md:w-14 rounded-full" | ||
src={sent ? "/Avatars/arjuna.png" : "/Avatars/krishna.png"} | ||
/> | ||
<div | ||
className={`flex flex-col gap-2 ${ | ||
sent ? 'justify-end items-end' : '' | ||
}`}> | ||
<p className='text-sm font-bold tracking-wider leading-none text-gray-800 uppercase whitespace-nowrap'> | ||
{sent ? 'Arjuna' : 'GitaGPT'} | ||
className={`flex flex-col gap-2 ${sent ? "justify-end items-end" : ""}`} | ||
> | ||
<p className="text-sm font-bold tracking-wider leading-none text-gray-800 uppercase whitespace-nowrap"> | ||
{sent ? "Arjuna" : "GitaGPT"} | ||
</p> | ||
<p className='text-xs tracking-wide leading-none text-gray-500'> | ||
<p className="text-xs tracking-wide leading-none text-gray-500"> | ||
{/* {useTimeFormat(time)} */} | ||
</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default UserDetails | ||
export default UserDetails; |
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 |
---|---|---|
@@ -1,39 +1,42 @@ | ||
import UserDetails from './UserDetails' | ||
import UserDetails from "./UserDetails"; | ||
|
||
interface ChatBubbleProps { | ||
// time: string | ||
message: string | ||
sent: boolean | ||
message: string; | ||
sent: boolean; | ||
} | ||
|
||
const ChatBubble = ({ message, sent }: ChatBubbleProps) => { | ||
const ChatBubble = ({ message, sent }: ChatBubbleProps) => { | ||
return ( | ||
<> | ||
<div | ||
className={`w-full flex items-start my-6 ${ | ||
sent ? 'justify-end' : 'justify-start' | ||
}`}> | ||
sent ? "justify-end" : "justify-start" | ||
}`} | ||
> | ||
<div | ||
className={`flex flex-col space-y-2 ${ | ||
sent ? 'justify-end items-end' : 'items-start justify-start' | ||
}`}> | ||
sent ? "justify-end items-end" : "items-start justify-start" | ||
}`} | ||
> | ||
{/* User Details */} | ||
<UserDetails sent={sent} /> | ||
{/* Text */} | ||
<div | ||
className={`flex flex-col items-start justify-start p-3 md:p-4 rounded-xl max-w-xl ${ | ||
sent | ||
? 'md:mr-6 rounded-tr-none bg-primary-500' | ||
: 'md:ml-6 rounded-tl-none bg-primary-100' | ||
}`}> | ||
<p className='text-sm md:text-base leading-normal text-gray-900'> | ||
? "md:mr-6 rounded-tr-none bg-primary-500" | ||
: "md:ml-6 rounded-tl-none bg-primary-100" | ||
}`} | ||
> | ||
<p className="text-sm md:text-base leading-normal text-gray-900"> | ||
{message} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default ChatBubble | ||
export default ChatBubble; |
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 |
---|---|---|
@@ -1,32 +1,30 @@ | ||
import ChatBubble from '@/components/ChatBubble' | ||
import Data from '@/constants/sampleData.json' | ||
import { SetStateAction } from 'react' | ||
import ChatBubble from "@/components/ChatBubble"; | ||
import Data from "@/constants/sampleData.json"; | ||
import { SetStateAction } from "react"; | ||
|
||
interface ChatSectionProps { | ||
showSuggestions: boolean | ||
showSuggestions: boolean; | ||
setShowSuggestions: React.Dispatch<SetStateAction<boolean>>; | ||
chat?:Array<{sent:boolean,message:string}>; | ||
|
||
chat?: Array<{ sent: boolean; message: string }>; | ||
} | ||
const ChatSection = ({showSuggestions,setShowSuggestions,chat}:ChatSectionProps) => { | ||
const ChatSection = ({ | ||
showSuggestions, | ||
setShowSuggestions, | ||
chat, | ||
}: ChatSectionProps) => { | ||
return ( | ||
<section className='overflow-auto scrollbar-none pr-2'> | ||
|
||
|
||
<section className="overflow-auto scrollbar-none pr-2"> | ||
<ChatBubble | ||
message='Radhey Radhey, I am GitaGPT, a repository of knowledge and wisdom. Allow me to assist you by answering any inquiries you may have. Ask me anything.' | ||
message="Radhey Radhey, I am GitaGPT, a repository of knowledge and wisdom. Allow me to assist you by answering any inquiries you may have. Ask me anything." | ||
sent={false} | ||
/> | ||
{ | ||
chat?.map((item:{sent:boolean,message:string},index:number)=>{ | ||
|
||
return <ChatBubble key={index} message={item.message} sent={item.sent} /> | ||
}) | ||
} | ||
|
||
|
||
{chat?.map((item: { sent: boolean; message: string }, index: number) => { | ||
return ( | ||
<ChatBubble key={index} message={item.message} sent={item.sent} /> | ||
); | ||
})} | ||
</section> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default ChatSection | ||
export default ChatSection; |
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 |
---|---|---|
@@ -1,22 +1,31 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
const Header = () => { | ||
return ( | ||
<header> | ||
<h1 className='text-4xl md:text-3xl flex items-center justify-center text-center bg-clip-text h-10 md:h-16 text-transparent bg-gradient-to-r from-yellow-500 to-orange-500 font-extrabold mb-1'> | ||
<h1 className="text-4xl md:text-3xl flex items-center justify-center text-center bg-clip-text h-10 md:h-16 text-transparent bg-gradient-to-r from-yellow-500 to-orange-500 font-extrabold mb-1"> | ||
BhagavadGita.ai | ||
</h1> | ||
<p className='text-md leading-normal text-center text-gray-500'> | ||
<p className="text-md leading-normal text-center text-gray-500"> | ||
Unlock Your Potential with GitaGPT - The AI-Powered Spiritual Companion | ||
</p> | ||
<p className='text-sm leading-normal text-center'><a className="text-transparent bg-clip-text bg-gradient-to-r from-yellow-400 to-amber-600" target="_blank" rel="noreferrer" href="https://writesonic.com/chat?utm_source=bhagavadgita.ai&utm_medium=banner&utm_campaign=bhagavadgita.ai">(Powered by ChatSonic)</a></p> | ||
<div className='flex items-start justify-start px-4 py-2 bg-gray-200 rounded-full mx-auto w-fit mt-3'> | ||
<p className='text-xs font-medium tracking-wide leading-none text-center text-black'> | ||
<p className="text-sm leading-normal text-center"> | ||
<a | ||
className="text-transparent bg-clip-text bg-gradient-to-r from-yellow-400 to-amber-600" | ||
target="_blank" | ||
rel="noreferrer" | ||
href="https://writesonic.com/chat?utm_source=bhagavadgita.ai&utm_medium=banner&utm_campaign=bhagavadgita.ai" | ||
> | ||
(Powered by ChatSonic) | ||
</a> | ||
</p> | ||
<div className="flex items-start justify-start px-4 py-2 bg-gray-200 rounded-full mx-auto w-fit mt-3"> | ||
<p className="text-xs font-medium tracking-wide leading-none text-center text-black"> | ||
250,000+ devotees guided so far | ||
</p> | ||
</div> | ||
</header> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
export default Header | ||
export default Header; |
Oops, something went wrong.