mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 18:13:25 +00:00
Added button and beginning of setup screen
This commit is contained in:
27
src/components/Button.tsx
Normal file
27
src/components/Button.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
import './Button.css';
|
||||
|
||||
export interface ButtonProps {
|
||||
type?: 'primary' | 'secondary';
|
||||
href?: string;
|
||||
children?: ReactNode;
|
||||
onClick?: () => void;
|
||||
full?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Button(props: ButtonProps) {
|
||||
const classes = `button button-${props.type ?? 'primary'} ${props.className ?? ''} ${props.full ? 'full' : ''}`;
|
||||
if (props.href)
|
||||
return (
|
||||
<a href={props.href} className={classes} target="_blank" rel="noreferrer">
|
||||
{props.children}
|
||||
</a>
|
||||
);
|
||||
return (
|
||||
<button className={classes} type="button" onClick={props.onClick}>
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user