-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb7412e
commit f276af5
Showing
1 changed file
with
30 additions
and
0 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,30 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
|
||
function ToggleContent({ children }: { children?: React.ReactNode }) { | ||
const [show, setShow] = useState(false); | ||
return ( | ||
<div> | ||
<button onClick={() => setShow(!show)}>Toggle</button> | ||
{show ? children : null} | ||
</div> | ||
); | ||
} | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<h1>Feat 1</h1> | ||
|
||
<ToggleContent> | ||
<p> | ||
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Dolorem, | ||
voluptatem mollitia suscipit odio eos fugiat eum in molestias itaque | ||
ex magni fuga deleniti dolores. Accusamus blanditiis reiciendis ab | ||
quibusdam saepe. | ||
</p> | ||
</ToggleContent> | ||
</> | ||
); | ||
} |