Skip to content
Snippets Groups Projects
Commit 6aa8c5c0 authored by insert's avatar insert
Browse files

All class name to be set on category / overline.

parent 4d9d7422
Branches
No related merge requests found
......@@ -31,18 +31,20 @@ const CategoryBase = styled.div<Pick<Props, 'variant'>>`
` }
`;
interface Props {
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
text: Children;
action?: () => void;
variant?: 'default' | 'uniform';
}
export default function Category(props: Props) {
let { text, action, ...otherProps } = props;
return (
<CategoryBase>
{props.text}
{props.action && (
<Plus size={16} onClick={props.action} />
<CategoryBase {...otherProps}>
{text}
{action && (
<Plus size={16} onClick={action} />
)}
</CategoryBase>
);
......
......@@ -2,7 +2,7 @@ import styled, { css } from "styled-components";
import { Children } from "../../types/Preact";
import { Text } from 'preact-i18n';
interface Props {
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
error?: string;
block?: boolean;
children?: Children;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment