22 lines
331 B
TypeScript
22 lines
331 B
TypeScript
|
"use client";
|
||
|
|
||
|
import { useRouter } from "next/navigation";
|
||
|
|
||
|
export default function BackButton({
|
||
|
className,
|
||
|
}: {
|
||
|
className?: string | undefined;
|
||
|
}) {
|
||
|
const router = useRouter();
|
||
|
return (
|
||
|
<button
|
||
|
className={className}
|
||
|
onClick={() => {
|
||
|
router.back();
|
||
|
}}
|
||
|
>
|
||
|
回退
|
||
|
</button>
|
||
|
);
|
||
|
}
|