import { ActionRow, Button } from '../../core';

export type ViewEditorActionsProps = {
  mode: 'create' | 'edit';
  onCancel: () => void;
  onSubmit: () => void;
  t: (key: string, fallback?: string, values?: Record<string, any>) => string;
};

export function ViewEditorActions({ mode, onCancel, onSubmit, t }: ViewEditorActionsProps) {
  return (
    <ActionRow className="ask-pt-2">
      <Button variant="ghost" onClick={onCancel}>
        {t('common.cancel', 'Cancel')}
      </Button>
      <Button variant="primary" onClick={onSubmit}>
        {mode === 'edit' ? t('common.save', 'Save') : t('ui.add_view', 'Create')}
      </Button>
    </ActionRow>
  );
}
