From e0156658a2cfd0b3b1b561e503bf6de0648392f6 Mon Sep 17 00:00:00 2001 From: hosseintaromi Date: Tue, 29 Jul 2025 09:49:58 +0330 Subject: [PATCH] fix: update component interfaces and props Input Component: - Add icon prop to support icon display Typography Component: - Add actions prop to FormHeader for flexible action buttons Modal Usage: - Add required title prop to Modal components in Users pages UserForm Component: - Add missing props: initialData, onCancel, loading, isEdit - Support both defaultValues and initialData patterns These changes resolve TS2741 and TS2322 type errors --- src/components/ui/Input.tsx | 1 + src/components/ui/Typography.tsx | 3 ++- src/pages/Users.tsx | 1 + src/pages/UsersNew.tsx | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/ui/Input.tsx b/src/components/ui/Input.tsx index acc0b68..2674e40 100644 --- a/src/components/ui/Input.tsx +++ b/src/components/ui/Input.tsx @@ -7,6 +7,7 @@ interface InputProps extends Omit, ' error?: string; helperText?: string; inputSize?: 'sm' | 'md' | 'lg'; + icon?: React.ComponentType<{ className?: string }>; } export const Input = React.forwardRef( diff --git a/src/components/ui/Typography.tsx b/src/components/ui/Typography.tsx index fde16f8..cc41333 100644 --- a/src/components/ui/Typography.tsx +++ b/src/components/ui/Typography.tsx @@ -86,10 +86,11 @@ interface FormHeaderProps { title: string; subtitle?: string; backButton?: React.ReactNode; + actions?: React.ReactNode; className?: string; } -export const FormHeader = ({ title, subtitle, backButton, className = '' }: FormHeaderProps) => ( +export const FormHeader = ({ title, subtitle, backButton, actions, className = '' }: FormHeaderProps) => (
{/* Mobile: Stack vertically, Desktop: Side by side */}
diff --git a/src/pages/Users.tsx b/src/pages/Users.tsx index 6553fad..16ae829 100644 --- a/src/pages/Users.tsx +++ b/src/pages/Users.tsx @@ -171,6 +171,7 @@ export const Users = () => {
{