Refactoring components

This commit is contained in:
Hazem Krimi
2023-03-19 18:21:12 +01:00
parent b82f90db48
commit 3a51b7fdb2
26 changed files with 171 additions and 158 deletions
+3 -13
View File
@@ -1,18 +1,8 @@
import { FC } from 'react';
import { StyledCard } from './styles';
import Image from 'next/image';
import { StyledCard } from './styles';
import { Props } from './types';
interface Props {
title: string;
description: string;
image?: string;
tags?: string[];
href: string;
target?: HTMLAnchorElement['target'];
onClick?: () => void;
}
const Card: FC<Props> = ({ title, description, image, tags, href, target, onClick }) => {
const Card = ({ title, description, image, tags, href, target, onClick }: Props) => {
return (
<StyledCard href={href} onClick={onClick} image={image ? Boolean(image) : undefined} target={target}>
<div className='card-content'>