mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
26 lines
753 B
TypeScript
26 lines
753 B
TypeScript
import * as React from 'react';
|
|
import { MouseEventHandler } from 'react';
|
|
import ExpandIcon from './ExpandIcon';
|
|
import EmptyExpandLink from './EmptyExpandLink';
|
|
|
|
interface ExpandLinkProps {
|
|
folderId: string;
|
|
folderTitle: string;
|
|
hasChildren: boolean;
|
|
isExpanded: boolean;
|
|
className: string;
|
|
onClick: MouseEventHandler<HTMLElement>;
|
|
}
|
|
|
|
const ExpandLink: React.FC<ExpandLinkProps> = props => {
|
|
return props.hasChildren ? (
|
|
<a className={`sidebar-expand-link ${props.className}`} data-folder-id={props.folderId} onClick={props.onClick} role='button'>
|
|
<ExpandIcon isVisible={true} isExpanded={props.isExpanded} targetTitle={props.folderTitle}/>
|
|
</a>
|
|
) : (
|
|
<EmptyExpandLink className={props.className}/>
|
|
);
|
|
};
|
|
|
|
export default ExpandLink;
|