Skip to content

Commit 41cbff7

Browse files
committed
feat: add button, fix form component types
1 parent 323bd65 commit 41cbff7

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/components/Button/Button.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { ButtonHTMLAttributes, FC, PropsWithChildren } from 'react'
2+
3+
export const Button: FC<PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>> = ({ children, ...props }) => (
4+
<button className="bg-blue-500 text-white px-4 py-2 rounded-md" type="submit" {...props}>
5+
{children}
6+
</button>
7+
)

src/components/Input/Input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import clsx from 'clsx'
2-
import type { FC, HTMLAttributes } from 'react'
2+
import type { FC, InputHTMLAttributes } from 'react'
33

4-
export const Input: FC<HTMLAttributes<HTMLInputElement>> = ({ className, ...props }) => (
4+
export const Input: FC<InputHTMLAttributes<HTMLInputElement>> = ({ className, ...props }) => (
55
<input className={clsx('border border-gray-300 rounded-md p-2', className)} {...props} />
66
)

src/components/Label/Label.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { FC, HTMLAttributes, PropsWithChildren } from 'react'
1+
import type { FC, LabelHTMLAttributes, PropsWithChildren } from 'react'
22

3-
export const Label: FC<PropsWithChildren<HTMLAttributes<HTMLLabelElement>>> = ({ children, ...props }) => (
3+
export const Label: FC<PropsWithChildren<LabelHTMLAttributes<HTMLLabelElement>>> = ({ children, ...props }) => (
44
<label className="text-sm font-medium" {...props}>
55
{children}
66
</label>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import clsx from 'clsx'
2-
import type { FC, HTMLAttributes } from 'react'
2+
import type { FC, TextareaHTMLAttributes } from 'react'
33

4-
export const Textarea: FC<HTMLAttributes<HTMLTextAreaElement>> = ({ className, ...props }) => (
4+
export const Textarea: FC<TextareaHTMLAttributes<HTMLTextAreaElement>> = ({ className, ...props }) => (
55
<textarea className={clsx('border border-gray-300 rounded-md p-2', className)} {...props} />
66
)

0 commit comments

Comments
 (0)