mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? [1] Add protected page [2] Add pending state ### Why? [1] People using incorrect ways to protect pages [2] No feedback that the login page is doing anything when buttons clicked ### How? [1] Redirect user to protected page after successful authentication [2] Use useFormStatus to determine whether the form is in a pending state --------- Co-authored-by: Sam Ko <[email protected]>
25 lines
546 B
TypeScript
25 lines
546 B
TypeScript
export default function Step({
|
|
title,
|
|
children,
|
|
}: {
|
|
title: string;
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<li className="mx-4">
|
|
<input type="checkbox" id={title} className={`mr-2 peer`} />
|
|
<label
|
|
htmlFor={title}
|
|
className={`text-lg text-foreground/90 peer-checked:line-through font-semibold hover:cursor-pointer`}
|
|
>
|
|
{title}
|
|
</label>
|
|
<div
|
|
className={`mx-6 text-foreground/80 text-sm peer-checked:line-through`}
|
|
>
|
|
{children}
|
|
</div>
|
|
</li>
|
|
);
|
|
}
|