mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
init
This commit is contained in:
30
packages/ui/src/base/button/index.tsx
Normal file
30
packages/ui/src/base/button/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user