2018-12-21 22:18:05 +03:00
|
|
|
import React from 'react';
|
2023-01-05 07:17:44 +03:00
|
|
|
import type { StylingFunction } from 'react-base16-styling';
|
2018-12-21 22:18:05 +03:00
|
|
|
|
2020-08-22 03:13:24 +03:00
|
|
|
interface Props {
|
|
|
|
styling: StylingFunction;
|
|
|
|
arrowStyle?: 'single' | 'double';
|
|
|
|
expanded: boolean;
|
|
|
|
nodeType: string;
|
|
|
|
onClick: React.MouseEventHandler<HTMLDivElement>;
|
|
|
|
}
|
|
|
|
|
2023-01-05 07:17:44 +03:00
|
|
|
export default function JSONArrow({
|
2020-08-22 03:13:24 +03:00
|
|
|
styling,
|
2023-01-05 07:17:44 +03:00
|
|
|
arrowStyle = 'single',
|
2020-08-22 03:13:24 +03:00
|
|
|
expanded,
|
|
|
|
nodeType,
|
|
|
|
onClick,
|
2023-01-05 07:17:44 +03:00
|
|
|
}: Props) {
|
|
|
|
return (
|
|
|
|
<div {...styling('arrowContainer', arrowStyle)} onClick={onClick}>
|
|
|
|
<div {...styling(['arrow', 'arrowSign'], nodeType, expanded, arrowStyle)}>
|
|
|
|
{'\u25B6'}
|
|
|
|
{arrowStyle === 'double' && (
|
|
|
|
<div {...styling(['arrowSign', 'arrowSignInner'])}>{'\u25B6'}</div>
|
|
|
|
)}
|
|
|
|
</div>
|
2018-12-21 22:18:05 +03:00
|
|
|
</div>
|
2023-01-05 07:17:44 +03:00
|
|
|
);
|
|
|
|
}
|