-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ai prompts are added * feat: ai chat | fix and improve some design and format --------- Co-authored-by: Kabir <[email protected]>
- Loading branch information
1 parent
5d25fe4
commit bab72bf
Showing
10 changed files
with
174 additions
and
41 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,20 @@ | ||
import React from "react"; | ||
|
||
const PromptCard = ({ prompt, handleSendDummyMessage, index }) => { | ||
return ( | ||
<button | ||
key={index} | ||
onClick={() => { | ||
handleSendDummyMessage(`${prompt.title}, ${prompt.description}`); | ||
}} | ||
className="border-solid w-full p-2.5 border-2 border-[#252525] rounded-lg hover:outline-red-500 hover:bg-[#252525] " | ||
> | ||
<p> | ||
{prompt.title} <br /> | ||
<span className="opacity-50">{prompt.description}</span> | ||
</p> | ||
</button> | ||
); | ||
}; | ||
|
||
export default PromptCard; |
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, { useState, useEffect } from "react"; | ||
import promptsData from "./prompts.json"; | ||
import PromptCard from "./PromptCard"; | ||
|
||
const Prompts = ({ handleSendDummyMessage }) => { | ||
const [prompts, setPrompts] = useState([]); | ||
|
||
useEffect(() => { | ||
// Shuffle the prompts array | ||
const shuffledPrompts = promptsData.sort(() => Math.random() - 0.5).slice(0, 6); | ||
setPrompts(shuffledPrompts); | ||
}, []); // Empty dependency array ensures the effect runs only once | ||
|
||
return ( | ||
<div> | ||
<div className="grid grid-cols-1 lg:grid-cols-2 md:grid-cols-2 sm:grid-cols-1 w-full h-full mb-4 lg:flex-row md:flex-row sm:flex-col gap-2"> | ||
{prompts.map((prompt, index) => ( | ||
<PromptCard | ||
key={index} | ||
prompt={prompt} | ||
index={index} | ||
handleSendDummyMessage={handleSendDummyMessage} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Prompts; |
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,51 @@ | ||
[ | ||
{ | ||
"title": "What is Cyber Security", | ||
"description": "Explain in detail about it." | ||
}, | ||
{ | ||
"title": "How to make website secure", | ||
"description": "by adding an extra layer of security." | ||
}, | ||
{ | ||
"title": "What is Data Breach", | ||
"description": "How to prevent it." | ||
}, | ||
{ | ||
"title": "What is Deep Web", | ||
"description": "How to access it." | ||
}, | ||
{ | ||
"title": "Importance of Encryption in Cyber Security", | ||
"description": "How encryption helps protect data in cyber security." | ||
}, | ||
{ | ||
"title": "Common Social Engineering Techniques", | ||
"description": "Identify and protect against social engineering attacks." | ||
}, | ||
{ | ||
"title": "Types of Malware and How to Combat Them", | ||
"description": "Explore different types of malware and strategies to defend against them." | ||
}, | ||
{ | ||
"title": "Best Practices for Password Security", | ||
"description": "Tips for creating strong and secure passwords to enhance cyber security." | ||
}, | ||
{ | ||
"title": "Web Application Security Best Practices", | ||
"description": "Ensure the security of web applications through best practices." | ||
}, | ||
{ | ||
"title": "SQL Injection and Prevention Measures", | ||
"description": "Understand SQL injection attacks and how to prevent them in web applications." | ||
}, | ||
{ | ||
"title": "Cross-Site Scripting (XSS) Vulnerabilities", | ||
"description": "Identify and mitigate cross-site scripting vulnerabilities in websites." | ||
}, | ||
{ | ||
"title": "Security Headers for Enhanced Web Security", | ||
"description": "Implement security headers to enhance the security of web applications." | ||
} | ||
] | ||
|
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
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