import React, { useCallback } from 'react'; import { ViewId } from '@veeqo/ui/dist/components/View/types'; import { theme, Tag, Text } from '@veeqo/ui'; import { IView } from 'types'; import { Row, Dots, Title, } from './styled'; export interface ViewProps extends IView { onClick?: (id: ViewId) => void; className?: string; } const View = ({ id, label, onClick, isDefault, className, }: ViewProps) => { const handleClick = useCallback( () => { if (onClick) onClick(id); }, [id, onClick], ); const classNames = { row: className && `${className}-row`, title: className && `${className}-title`, tag: className && `${className}-tag`, text: className && `${className}-text`, dots: className && `${className}-dots`, }; return ( {label} {isDefault && ( Default )} {onClick && ( )} ); }; export default View;