Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 14x | import React from 'react';
interface SelectorButtonProps {
testId: string;
selected: boolean;
onClick: () => void;
children: React.ReactNode;
className?: string;
}
export const SelectorButton = React.memo(function SelectorButton({
testId,
selected,
onClick,
children,
className = '',
}: SelectorButtonProps) {
return (
<button
data-testid={testId}
onClick={onClick}
className={`relative grid place-items-center rounded-full border border-gray-200 bg-white p-1
hover:bg-gray-50 transition shrink-0
${selected ? 'ring-2 ring-offset-1 ring-indigo-400' : ''}
${className}`}
>
{children}
</button>
);
});
|