import { useTranslation } from 'react-i18next'; import { TooltipContent } from '../../types/tips'; /** * Reusable tooltip for page selection functionality. * Can be used by any tool that uses the GeneralUtils.parsePageList syntax. */ export const usePageSelectionTips = (): TooltipContent => { const { t } = useTranslation(); return { header: { title: t("pageSelection.tooltip.header.title", "Page Selection Guide") }, tips: [ { description: t("pageSelection.tooltip.description", "Choose which pages to use for the operation. Supports single pages, ranges, formulas, and the all keyword.") }, { title: t("pageSelection.tooltip.individual.title", "Individual Pages"), description: t("pageSelection.tooltip.individual.description", "Enter numbers separated by commas."), bullets: [ t("pageSelection.tooltip.individual.bullet1", "1,3,5 → selects pages 1, 3, 5"), t("pageSelection.tooltip.individual.bullet2", "2,7,12 → selects pages 2, 7, 12") ] }, { title: t("pageSelection.tooltip.ranges.title", "Page Ranges"), description: t("pageSelection.tooltip.ranges.description", "Use - for consecutive pages."), bullets: [ t("pageSelection.tooltip.ranges.bullet1", "3-6 → selects pages 3–6"), t("pageSelection.tooltip.ranges.bullet2", "10-15 → selects pages 10–15"), t("pageSelection.tooltip.ranges.bullet3", "5- → selects pages 5 to end") ] }, { title: t("pageSelection.tooltip.mathematical.title", "Mathematical Functions"), description: t("pageSelection.tooltip.mathematical.description", "Use n in formulas for patterns."), bullets: [ t("pageSelection.tooltip.mathematical.bullet2", "2n-1 → all odd pages (1, 3, 5…)"), t("pageSelection.tooltip.mathematical.bullet1", "2n → all even pages (2, 4, 6…)"), t("pageSelection.tooltip.mathematical.bullet3", "3n → every 3rd page (3, 6, 9…)"), t("pageSelection.tooltip.mathematical.bullet4", "4n-1 → pages 3, 7, 11, 15…") ] }, { title: t("pageSelection.tooltip.special.title", "Special Keywords"), bullets: [ t("pageSelection.tooltip.special.bullet1", "all → selects all pages"), ] }, { title: t("pageSelection.tooltip.complex.title", "Complex Combinations"), description: t("pageSelection.tooltip.complex.description", "Mix different types."), bullets: [ t("pageSelection.tooltip.complex.bullet1", "1,3-5,8,2n → pages 1, 3–5, 8, plus evens"), t("pageSelection.tooltip.complex.bullet2", "10-,2n-1 → from page 10 to end + odd pages") ] } ] }; };