diff --git a/src/components/ui/Category.tsx b/src/components/ui/Category.tsx index 16c14444015533477b89e07561ab7bc66b3834ba..ccdd4e91c3b8ddf6fbb7849d117d48a40dc757da 100644 --- a/src/components/ui/Category.tsx +++ b/src/components/ui/Category.tsx @@ -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> ); diff --git a/src/components/ui/Overline.tsx b/src/components/ui/Overline.tsx index 86233697b79b414e4523da41141a4862bb749c3d..5a9f9d04ca4af9446550599bcb6de8ebd1b2513f 100644 --- a/src/components/ui/Overline.tsx +++ b/src/components/ui/Overline.tsx @@ -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;