2023-09-29 15:33:32 +03:00
|
|
|
import { Grammeme } from '../../models/language';
|
|
|
|
|
2023-09-30 17:16:20 +03:00
|
|
|
interface WordformButtonProps {
|
2023-09-29 15:33:32 +03:00
|
|
|
text: string
|
|
|
|
example: string
|
|
|
|
grams: Grammeme[]
|
|
|
|
isSelected?: boolean
|
|
|
|
onSelectGrams: (grams: Grammeme[]) => void
|
|
|
|
}
|
|
|
|
|
2023-11-27 13:50:56 +03:00
|
|
|
function WordformButton({ text, example, grams, onSelectGrams, isSelected, ...restProps }: WordformButtonProps) {
|
2023-09-29 15:33:32 +03:00
|
|
|
return (
|
2023-12-07 01:21:27 +03:00
|
|
|
<button type='button' tabIndex={-1}
|
|
|
|
onClick={() => onSelectGrams(grams)}
|
|
|
|
className={`min-w-[6rem] p-1 border rounded-none cursor-pointer clr-btn-clear clr-hover ${isSelected ? 'clr-selected': ''}`}
|
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
<p className='font-semibold'>{text}</p>
|
|
|
|
<p>{example}</p>
|
|
|
|
</button>);
|
2023-09-29 15:33:32 +03:00
|
|
|
}
|
|
|
|
|
2023-09-30 17:16:20 +03:00
|
|
|
export default WordformButton;
|