import { useTranslation } from "react-i18next"; import { createToolFlow } from "../components/tools/shared/createToolFlow"; import CropSettings from "../components/tools/crop/CropSettings"; import { useCropParameters } from "../hooks/tools/crop/useCropParameters"; import { useCropOperation } from "../hooks/tools/crop/useCropOperation"; import { useBaseTool } from "../hooks/tools/shared/useBaseTool"; import { BaseToolProps, ToolComponent } from "../types/tool"; const Crop = (props: BaseToolProps) => { const { t } = useTranslation(); const base = useBaseTool( 'crop', useCropParameters, useCropOperation, props ); return createToolFlow({ files: { selectedFiles: base.selectedFiles, isCollapsed: base.hasResults, minFiles: 1, }, steps: [ { title: t("crop.steps.selectArea", "Select Crop Area"), isCollapsed: !base.hasFiles, // Collapsed until files selected onCollapsedClick: base.hasResults ? base.handleSettingsReset : undefined, tooltip: { content: (
{t("crop.tooltip.description", "Select the area to crop from your PDF by dragging and resizing the red overlay on the thumbnail.")}