-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/joshsoftware/lingo.ai into dev
- Loading branch information
Showing
6 changed files
with
76 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client' | ||
|
||
import { useRouter } from "next/navigation" | ||
import { Button } from "./ui/button" | ||
import { ArrowLeftIcon } from "lucide-react" | ||
|
||
interface NavigateBackProps { | ||
href?: string | ||
subHeading?: string | ||
} | ||
|
||
const NavigateBack = (props: NavigateBackProps) => { | ||
const { href, subHeading } = props | ||
const router = useRouter() | ||
|
||
const handleBack = () => { | ||
href ? router.push(href) : router.back() | ||
} | ||
|
||
return ( | ||
<div className="flex justify-between items-center w-full"> | ||
<Button className="flex gap-4" variant={"ghost"} onClick={handleBack}> | ||
<ArrowLeftIcon className="w-6 h-6" /> | ||
Back | ||
</Button> | ||
{subHeading && <div className="w-full flex justify-center items-center text-2xl font-bold">{subHeading}</div>} | ||
</div> | ||
) | ||
} | ||
|
||
export default NavigateBack |
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