mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
34 lines
592 B
TypeScript
34 lines
592 B
TypeScript
import { FC } from 'react';
|
|
import styled from 'styled-components';
|
|
import Image from 'next/image';
|
|
interface Props {
|
|
icon: string;
|
|
width?: number;
|
|
height?: number;
|
|
onClick?: () => void;
|
|
}
|
|
|
|
const Btn = styled.button`
|
|
cursor: pointer;
|
|
background: none;
|
|
border: none;
|
|
display: flex;
|
|
align-items: center;
|
|
`;
|
|
|
|
const IconButton: FC<Props & { className?: string }> = ({
|
|
icon,
|
|
onClick,
|
|
className,
|
|
width = 24,
|
|
height = 24
|
|
}) => {
|
|
return (
|
|
<Btn onClick={onClick} className={className}>
|
|
<Image src={icon} width={width} height={height} />
|
|
</Btn>
|
|
);
|
|
};
|
|
|
|
export default IconButton;
|