import clsx from 'clsx'; import { IconAnimation, IconAnimationOff, IconDestroy, IconFitImage, IconGrid, IconImage, IconLineStraight, IconLineWave, IconNewItem, IconReset, IconSave } from '@/components/Icons'; import BadgeHelp from '@/components/info/BadgeHelp'; import MiniButton from '@/components/ui/MiniButton'; import { HelpTopic } from '@/models/miscellaneous'; import { PARAMETER } from '@/utils/constants'; import { prepareTooltip } from '@/utils/labels'; import { useOssEdit } from '../OssEditContext'; interface ToolbarOssGraphProps { isModified: boolean; showGrid: boolean; edgeAnimate: boolean; edgeStraight: boolean; onCreate: () => void; onDelete: () => void; onFitView: () => void; onSaveImage: () => void; onSavePositions: () => void; onResetPositions: () => void; toggleShowGrid: () => void; toggleEdgeAnimate: () => void; toggleEdgeStraight: () => void; } function ToolbarOssGraph({ isModified, showGrid, edgeAnimate, edgeStraight, onCreate, onDelete, onFitView, onSaveImage, onSavePositions, onResetPositions, toggleShowGrid, toggleEdgeAnimate, toggleEdgeStraight }: ToolbarOssGraphProps) { const controller = useOssEdit(); return (
} title='Сбросить вид' onClick={onFitView} /> ) : ( ) } onClick={toggleShowGrid} /> ) : ( ) } onClick={toggleEdgeStraight} /> ) : ( ) } onClick={toggleEdgeAnimate} /> } title='Сохранить изображение' onClick={onSaveImage} />
{controller.isMutable ? (
{' '} } disabled={controller.isProcessing || !isModified} onClick={onSavePositions} /> } disabled={!isModified} onClick={onResetPositions} /> } disabled={controller.isProcessing} onClick={onCreate} /> } disabled={controller.selected.length !== 1 || controller.isProcessing} onClick={onDelete} />
) : null}
); } export default ToolbarOssGraph;