Files
ServerKit/frontend/src/components/IconButton.jsx
T
Juan DenisandClaude Opus 4.8 ad9acb89e3 refactor(frontend): Phase 5 §8.5 — drop 142 unused React imports (JSX transform)
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.5. React 18's automatic
JSX runtime makes 'import React' unnecessary; removed it from the 142 files
eslint flagged as 'React defined but never used' (named imports like useState
preserved). Driven by an eslint --format json pass so only flagged files were
touched.

Lint warnings: 1603 -> 1461 (0 errors). Verified: npm run build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:44:16 -04:00

39 lines
883 B
React

import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
/**
* Accessible icon-only button. Always provide a descriptive label; it is used
* for the aria-label and optional title.
*
* <IconButton icon={<RefreshCw size={16} />} label="Refresh" onClick={load} />
*/
export function IconButton({
icon,
label,
onClick,
variant = 'ghost',
size = 'sm',
className,
title,
disabled,
...props
}) {
return (
<Button
type="button"
variant={variant}
size="icon"
className={cn('icon-button', size === 'sm' && 'btn-sm', className)}
onClick={onClick}
disabled={disabled}
aria-label={label}
title={title || label}
{...props}
>
{icon}
</Button>
);
}
export default IconButton;