import * as React from 'react'; import { ReactNode, useEffect, useRef } from 'react'; import { focus } from '@joplin/lib/utils/focusHandler'; interface Props { position?: 'bottom-center' | 'top-center' | 'top-right'; caption?: ReactNode; children?: ReactNode; } export const ActionPanel = ({ position = 'bottom-center', caption, children }: Props) => { return (
{caption ? ( <>
{caption}
) : null} {children}
); }; interface ActionButtonProps { onClick: ()=> void; active?: boolean; disabled?: boolean; title?: string; children: ReactNode; } export const ActionButton = ({ onClick, active, disabled, title, children }: ActionButtonProps) => { const classes = ['button']; if (active) classes.push('-active'); return ( ); }; export const ActionDivider = () =>
; interface ActionSwatchProps { color: string | null; active?: boolean; title?: string; onClick: ()=> void; } export const ActionSwatch = ({ color, active, title, onClick }: ActionSwatchProps) => { const classes = ['swatch']; if (active) classes.push('-active'); if (color === null) classes.push('-none'); return (