import type { ButtonHTMLAttributes, DetailedHTMLProps } from 'react'; import { memo } from 'react'; import { useTranslation } from 'next-i18next'; import styles from './SwitchingButtonGroup.module.scss'; const moduleClass = styles['btn-group-switching'] ?? ''; type SwitchingButtonProps = DetailedHTMLProps, HTMLButtonElement> & { active?: boolean, } const SwitchingButton = memo((props: SwitchingButtonProps) => { const { active, className, children, onClick, ...rest } = props; return ( ); }); type Props = { showPreview: boolean, onSelected?: (showPreview: boolean) => void, }; export const SwitchingButtonGroup = (props: Props): JSX.Element => { const { t } = useTranslation(); const { showPreview, onSelected, } = props; return (
onSelected?.(true)} > play_arrow {t('Preview')} onSelected?.(false)} > edit_square {t('Write')}
); };