mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 18:44:05 +02:00
# Description of Changes Enable ESLint [no-unused-vars rule](https://typescript-eslint.io/rules/no-unused-vars/)
34 lines
1005 B
TypeScript
34 lines
1005 B
TypeScript
import { Box } from '@mantine/core';
|
|
import ToolButton from '../toolPicker/ToolButton';
|
|
import SubcategoryHeader from './SubcategoryHeader';
|
|
|
|
import { getSubcategoryLabel } from "../../../data/toolsTaxonomy";
|
|
import { TFunction } from 'i18next';
|
|
import { SubcategoryGroup } from '../../../hooks/useToolSections';
|
|
|
|
// Helper function to render tool buttons for a subcategory
|
|
export const renderToolButtons = (
|
|
t: TFunction,
|
|
subcategory: SubcategoryGroup,
|
|
selectedToolKey: string | null,
|
|
onSelect: (id: string) => void,
|
|
showSubcategoryHeader: boolean = true
|
|
) => (
|
|
<Box key={subcategory.subcategoryId} w="100%">
|
|
{showSubcategoryHeader && (
|
|
<SubcategoryHeader label={getSubcategoryLabel(t, subcategory.subcategoryId)} />
|
|
)}
|
|
<div>
|
|
{subcategory.tools.map(({ id, tool }) => (
|
|
<ToolButton
|
|
key={id}
|
|
id={id}
|
|
tool={tool}
|
|
isSelected={selectedToolKey === id}
|
|
onSelect={onSelect}
|
|
/>
|
|
))}
|
|
</div>
|
|
</Box>
|
|
);
|