feat: add product generation and pagination components
- Implemented product generation for categories with a helper function to create 50 products per category. - Added image assets for English and Persian language support. - Created a reusable Pagination component for navigating through product lists. - Developed ProductList component to display products with pagination support. - Defined TypeScript interfaces for product list props and API response structure.
This commit is contained in:
+1
@@ -8,6 +8,7 @@ export interface IBaseButtonProps
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
link?: URL | string;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
export interface ITextButtonProps extends IBaseButtonProps {
|
||||
|
||||
@@ -11,6 +11,7 @@ const Button: React.FC<ITextButtonProps> = ({
|
||||
endIcon,
|
||||
className,
|
||||
link,
|
||||
onClick,
|
||||
...props
|
||||
}) => {
|
||||
const wrapperClass = `group bg-primary relative h-12 cursor-pointer rounded-[0.5625rem] p-[0.125rem] flex w-fit ${className || ''}`;
|
||||
@@ -22,7 +23,12 @@ const Button: React.FC<ITextButtonProps> = ({
|
||||
</ButtonBody>
|
||||
</Link>
|
||||
) : (
|
||||
<button disabled={disabled || loading} {...props} className={wrapperClass}>
|
||||
<button
|
||||
disabled={disabled || loading}
|
||||
{...props}
|
||||
onClick={onClick}
|
||||
className={wrapperClass}
|
||||
>
|
||||
<ButtonBody {...props} loading={loading} endIcon={endIcon}>
|
||||
{children}
|
||||
</ButtonBody>
|
||||
@@ -82,6 +88,7 @@ export const IconButton: React.FC<IIconButtonProps> = ({
|
||||
size = 'medium',
|
||||
color = 'primary',
|
||||
className,
|
||||
onClick,
|
||||
...props
|
||||
}) => {
|
||||
const colorClass =
|
||||
@@ -95,6 +102,7 @@ export const IconButton: React.FC<IIconButtonProps> = ({
|
||||
className={`group relative flex cursor-pointer items-center justify-center rounded-[0.5625rem] ${colorClass} ${sizeClass} ${className || ''} `}
|
||||
disabled={disabled || loading}
|
||||
{...props}
|
||||
onClick={onClick}
|
||||
>
|
||||
{loading ? (
|
||||
<svg
|
||||
|
||||
Reference in New Issue
Block a user