mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-Storyless): replace img with Image component for optimized loading
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/helper';
|
import { cn } from '@/lib/helper';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
||||||
title?: string;
|
title?: string;
|
||||||
@@ -108,7 +109,7 @@ const Card = ({
|
|||||||
return (
|
return (
|
||||||
<div className={getCardClasses()} {...props}>
|
<div className={getCardClasses()} {...props}>
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<Image
|
||||||
src={image}
|
src={image}
|
||||||
alt={imageAlt || title || 'Card image'}
|
alt={imageAlt || title || 'Card image'}
|
||||||
className={getImageClasses()}
|
className={getImageClasses()}
|
||||||
@@ -129,7 +130,7 @@ const Card = ({
|
|||||||
<div className={getCardClasses()} {...props}>
|
<div className={getCardClasses()} {...props}>
|
||||||
{image && (
|
{image && (
|
||||||
<figure>
|
<figure>
|
||||||
<img
|
<Image
|
||||||
src={image}
|
src={image}
|
||||||
alt={imageAlt || title || 'Card image'}
|
alt={imageAlt || title || 'Card image'}
|
||||||
className={getImageClasses()}
|
className={getImageClasses()}
|
||||||
|
|||||||
Reference in New Issue
Block a user