From b1200288171c147f66fde122f58dad2aafa14d19 Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Tue, 2 Jun 2026 21:55:28 -0600 Subject: [PATCH] Button exercise: adding props --- src/App.tsx | 9 +++++++-- src/components/Button.tsx | 11 +++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 2ae4da2..cb114dd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,16 @@ import { Button } from "./components/Button"; - +function handleOnClick() { + console.log("Clicked"); +} function App() { + + + return (
-
); } diff --git a/src/components/Button.tsx b/src/components/Button.tsx index d0ba658..52792dc 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,6 +1,13 @@ -export const Button = () => { +interface Props { + children: string; + color: string; + onClick: () => void; +} + +export const Button = ({ children, color, onClick }: Props) => { + //const buttonType = "btn " + "btn"+"-"+{type}; return ( - + ) }