'use client'; import * as React from 'react'; import { classNames } from '@vkontakte/vkjs'; import { usePlatform } from '../../hooks/usePlatform'; import type { AnchorHTMLAttributesOnly } from '../../types'; import { Button, type ButtonProps } from '../Button/Button'; import { Tappable } from '../Tappable/Tappable'; import type { AlertActionInterface } from './Alert'; import styles from './Alert.module.css'; export interface AlertActionProps extends Pick, AnchorHTMLAttributesOnly { /** * Содержимое компонента. */ children: string; /** * Обработчик нажатия. */ onClick: React.MouseEventHandler; } const AlertActionIos = ({ mode, ...restProps }: AlertActionProps) => { return ( ); }; const AlertActionBase = ({ mode, ...restProps }: AlertActionProps) => { const platform = usePlatform(); let buttonMode: ButtonProps['mode'] = 'tertiary'; if (platform === 'vkcom') { buttonMode = mode === 'cancel' ? 'secondary' : 'primary'; } return (