mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
31 lines
583 B
TypeScript
31 lines
583 B
TypeScript
import { styled } from 'styled-components';
|
|
import { View } from '../view';
|
|
|
|
type ButtonProps = {
|
|
title: React.ReactNode;
|
|
icon?: React.ReactNode;
|
|
onClick?: () => void;
|
|
};
|
|
|
|
const ButtonWrapper = styled(View)`
|
|
background-color: ${({ theme }) => theme.colors.bg.highlight};
|
|
display: inline-flex;
|
|
`;
|
|
|
|
const Button: React.FC<ButtonProps> = ({ title, onClick, icon }) => {
|
|
return (
|
|
<ButtonWrapper
|
|
$p="sm"
|
|
as="button"
|
|
onClick={onClick}
|
|
$items="center"
|
|
$gap="sm"
|
|
>
|
|
{icon}
|
|
{title}
|
|
</ButtonWrapper>
|
|
);
|
|
};
|
|
|
|
export { Button };
|