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
This commit is contained in:
hosseintaromi 2025-07-29 09:49:58 +03:30
parent 57287c866c
commit e0156658a2
4 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
error?: string;
helperText?: string;
inputSize?: 'sm' | 'md' | 'lg';
icon?: React.ComponentType<{ className?: string }>;
}
export const Input = React.forwardRef<HTMLInputElement, InputProps>(

View File

@ -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) => (
<div className={`space-y-3 sm:space-y-4 ${className}`}>
{/* Mobile: Stack vertically, Desktop: Side by side */}
<div className="flex flex-col space-y-3 sm:flex-row sm:items-center sm:gap-4 sm:space-y-0">

View File

@ -171,6 +171,7 @@ export const Users = () => {
</div>
<Modal
title={editingUser ? "ویرایش کاربر" : "افزودن کاربر"}
isOpen={showUserModal}
onClose={handleCloseModal}
size="lg"

View File

@ -233,6 +233,7 @@ const Users = () => {
</div>
<Modal
title={editingUser ? "ویرایش کاربر" : "افزودن کاربر"}
isOpen={showUserModal}
onClose={handleCloseModal}
size="lg"