mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-04-18 00:21:18 +00:00
Update NodeImage component to use next/image for better performance and responsiveness.
This commit is contained in:
parent
439fdfb84b
commit
0ac61933e6
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { UiNode, UiNodeImageAttributes } from '@ory/client';
|
import { UiNode, UiNodeImageAttributes } from '@ory/client';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
node: UiNode;
|
node: UiNode;
|
||||||
|
@ -7,10 +8,10 @@ interface Props {
|
||||||
|
|
||||||
export const NodeImage = ({ node, attributes }: Props) => {
|
export const NodeImage = ({ node, attributes }: Props) => {
|
||||||
return (
|
return (
|
||||||
<img
|
<Image
|
||||||
src={attributes.src}
|
src={attributes.src}
|
||||||
width={200}
|
width={200}
|
||||||
alt={node.meta.label?.text}
|
alt={node.meta.label?.text || 'Image'}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue