nwex.de/src/components/SocialBadge/index.tsx

23 lines
726 B
TypeScript
Raw Normal View History

2021-04-04 18:02:52 +02:00
import React from "react";
2021-04-04 17:33:34 +02:00
export interface SocialBadgeProps {
2021-04-04 18:02:52 +02:00
title: string
link: string,
imagePath: string
2021-04-04 17:33:34 +02:00
}
2021-04-04 18:02:52 +02:00
export const SocialBadge: React.FC<SocialBadgeProps> = ({title, link, imagePath}) => {
link = link ?? "/404";
title = title ?? "Unbekannt";
console.log(imagePath);
return (
<a className="block bg-white rounded-full shadow-lg p-2 flex w-max items-center cursor-pointer transition-transform transform hover:scale-105 focus:outline-none focus:ring h-16"
href={link}>
{imagePath?(<img className={`flex rounded-full h-12 w-12 object-cover`} src={imagePath}/>):null}
2021-04-04 18:02:52 +02:00
<div className="mx-4 font-semibold text-xl">{title}</div>
</a>
)
2021-04-04 17:33:34 +02:00
}