diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/button.tsx | 9 | ||||
-rw-r--r-- | components/image.tsx | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/components/button.tsx b/components/button.tsx new file mode 100644 index 0000000..452d85f --- /dev/null +++ b/components/button.tsx @@ -0,0 +1,9 @@ +export default function Button(props: { + text: string; + href?: string; + onclick?: () => void; +}) { + return props.href ? + <a href={props.href} className="button">{props.text}</a> : + <button onClick={props.onclick} className="button">{props.text}</button> +} diff --git a/components/image.tsx b/components/image.tsx new file mode 100644 index 0000000..106c2bd --- /dev/null +++ b/components/image.tsx @@ -0,0 +1,13 @@ +export default function Image(props: { + src: string; + title?: string; +}) { + return <div className="image"> + <img src={props.src} alt={props.title}/> + { + props.title && <div> + <p>{props.title}</p> + </div> + } + </div> +} |