2024-04-25 16:31:18 +02:00
|
|
|
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;
|
2024-10-15 18:59:51 +02:00
|
|
|
className: string;
|
2024-04-25 16:31:18 +02:00
|
|
|
onClick: MouseEventHandler<HTMLElement>;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ExpandLink: React.FC<ExpandLinkProps> = props => {
|
|
|
|
return props.hasChildren ? (
|
2024-10-15 18:59:51 +02:00
|
|
|
<a className={`sidebar-expand-link ${props.className}`} data-folder-id={props.folderId} onClick={props.onClick} role='button'>
|
2024-04-25 16:31:18 +02:00
|
|
|
<ExpandIcon isVisible={true} isExpanded={props.isExpanded} targetTitle={props.folderTitle}/>
|
|
|
|
</a>
|
|
|
|
) : (
|
2024-10-15 18:59:51 +02:00
|
|
|
<EmptyExpandLink className={props.className}/>
|
2024-04-25 16:31:18 +02:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ExpandLink;
|