1
Fork 0
mirror of https://github.com/Steffo99/steffoweb.git synced 2024-11-24 17:14:30 +00:00
steffoweb/components/ProjectPanel.tsx

38 lines
1 KiB
TypeScript
Raw Normal View History

2022-10-16 23:58:17 +00:00
import {default as Link} from "next/link"
import React from "react"
import {default as cn} from "classnames"
import {default as Image, ImageProps} from "next/future/image"
import {default as style} from "./ProjectPanel.module.css"
export type ProjectPanelProps = Pick<ImageProps, "src"> & {
href?: string,
name: string
description: React.ReactNode,
}
export const ProjectPanel = ({src, href, name, description}: ProjectPanelProps) => {
const panel = (
<a className={cn({panel: true, [style.projectPanel]: true})}>
2022-10-20 15:44:10 +00:00
<Image alt={name} src={src} className={cn({[style.projectImage]: true})} width={228} height={114}/>
2022-10-16 23:58:17 +00:00
<div className={cn({[style.projectDescription]: true})}>
<h4>{name}</h4>
<p>
{description}
</p>
</div>
</a>
)
if(href) {
return (
<Link href={href}>
{panel}
</Link>
)
}
else {
return panel
}
}