2023-12-03 23:02:09 +07:00
|
|
|
"use client"
|
|
|
|
import Image from 'next/image';
|
|
|
|
import Link from 'next/link';
|
|
|
|
import React from "react";
|
|
|
|
|
2023-12-23 11:21:03 +07:00
|
|
|
const Photo = ({src, href, alt}: any) => {
|
2023-12-21 20:40:11 +07:00
|
|
|
let classes = "transition ease-in-out delay-150 hover:scale-105 duration-300";
|
2023-12-03 23:02:09 +07:00
|
|
|
|
|
|
|
if(!href || href == "#") {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className="grid content-center">
|
|
|
|
<div className={classes}>
|
|
|
|
<Image
|
|
|
|
className="h-auto max-w-full rounded-lg"
|
|
|
|
src={src}
|
|
|
|
width={0}
|
|
|
|
height={0}
|
|
|
|
sizes="100vw"
|
|
|
|
style={{ width: '100%', height: 'auto' }}
|
|
|
|
alt={alt}
|
|
|
|
/>
|
|
|
|
|
2023-12-03 23:16:22 +07:00
|
|
|
<span className="text-xs m-2 text-zinc-600 dark:text-zinc-400">{alt}</span>
|
2023-12-03 23:02:09 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Link
|
|
|
|
href={href}
|
|
|
|
>
|
|
|
|
<div className="grid content-center">
|
|
|
|
<div className={classes}>
|
|
|
|
<Image
|
|
|
|
className="h-auto max-w-full rounded-lg"
|
|
|
|
src={src}
|
|
|
|
width={0}
|
|
|
|
height={0}
|
|
|
|
sizes="100vw"
|
|
|
|
style={{ width: '100%', height: 'auto' }}
|
|
|
|
alt={alt}
|
|
|
|
/>
|
|
|
|
|
2023-12-03 23:16:22 +07:00
|
|
|
<span className="text-xs m-2 text-zinc-600 dark:text-zinc-400">{alt}</span>
|
2023-12-03 23:02:09 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Photo;
|