-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Multi-Step Form * feat: changes ui * feat: Gemini Integaretion * feat: Modal For Cover Letter
- Loading branch information
Showing
4 changed files
with
108 additions
and
7 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,70 @@ | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from "@/components/ui/dialog"; | ||
import { SetStateAction, useState } from "react"; | ||
import { Textarea } from "./ui/textarea"; | ||
import { Button } from "./ui/button"; | ||
import { useToast } from "./ui/use-toast"; | ||
|
||
type Props = { | ||
setIsResponseGenerated: React.Dispatch<SetStateAction<boolean>>; | ||
setResponse: React.Dispatch<SetStateAction<string>>; | ||
isResponseGenerated: boolean; | ||
response: string; | ||
isError: boolean; | ||
}; | ||
|
||
export default function CoverLetterDialog({ | ||
isResponseGenerated, | ||
setIsResponseGenerated, | ||
response, | ||
setResponse, | ||
isError, | ||
}: Props) { | ||
const { toast } = useToast(); | ||
const copyHandler = () => { | ||
navigator.clipboard.writeText(response); | ||
toast({ | ||
title: "Cover Letter", | ||
description: "Text Copied!!", | ||
}); | ||
}; | ||
|
||
return ( | ||
<Dialog open={isResponseGenerated} onOpenChange={setIsResponseGenerated}> | ||
<DialogTrigger></DialogTrigger> | ||
<DialogContent className="sm:w-[700px]"> | ||
{!isError && ( | ||
<> | ||
<DialogHeader className="flex flex-row w-full items-center justify-between"> | ||
<DialogTitle>Cover Letter</DialogTitle> | ||
</DialogHeader> | ||
|
||
<Textarea | ||
className="w-full sm:h-[550px] h-[400px]" | ||
value={response} | ||
onChange={(e) => setResponse(e.target.value)} | ||
></Textarea> | ||
|
||
<Button onClick={() => copyHandler()}>Copy!</Button> | ||
</> | ||
)} | ||
{isError && ( | ||
<> | ||
<DialogHeader className="flex flex-row w-full items-center justify-between"> | ||
<DialogTitle>Error</DialogTitle> | ||
</DialogHeader> | ||
<DialogDescription> | ||
Error Occured!! Please try again later. | ||
</DialogDescription> | ||
</> | ||
)} | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
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,12 @@ | ||
import React from "react"; | ||
|
||
export default function Loader() { | ||
return ( | ||
<div className="flex gap-2 justify-center items-center"> | ||
<span className="sr-only">Loading...</span> | ||
<div className="h-2 w-2 bg-black rounded-full animate-pulse [animation-delay:-0.3s]"></div> | ||
<div className="h-2 w-2 bg-black rounded-full animate-pulse [animation-delay:-0.15s]"></div> | ||
<div className="h-2 w-2 bg-black rounded-full animate-pulse"></div> | ||
</div> | ||
); | ||
} |
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