File size: 1,562 Bytes
07bbbbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React from 'react';
import {
  IonPage,
  IonHeader,
  IonToolbar,
  IonTitle,
  IonContent,
  IonButton,
  IonButtons,
  IonIcon,
} from '@ionic/react';
import { arrowBackOutline } from 'ionicons/icons';
import { useTranslation } from 'react-i18next';

import { MdxProfile } from '../../../types';
import { ProfileListView } from '../ProfileListView';

/**
 * GroupEditView Component
 * 
 * Displays the edit view for a dictionary group.
 * Allows managing (enabling/disabling, reordering) profiles within a group.
 */

export interface GroupEditViewProps {
  group: MdxProfile;
  onBack: () => void;
  onSelectProfile?: (profileId: number) => void;
}

export const GroupEditView: React.FC<GroupEditViewProps> = ({
  group,
  onBack,
  onSelectProfile,
}) => {
  const { t } = useTranslation();
  
  return (
    <IonPage>
      {/* Group navigation bar */}
      <IonHeader>
        <IonToolbar>
          <IonButtons slot="start">
            <IonButton onClick={onBack}>
              <IonIcon slot="icon-only" icon={arrowBackOutline} />
            </IonButton>
          </IonButtons>
          <IonTitle>{group.title} - {t('Dictionary Management')}</IonTitle>
        </IonToolbar>
      </IonHeader>
      
      <IonContent>
      <div style={{ padding: '16px' }}>          
        <div style={{ minHeight: 0 }}>
          <ProfileListView
            parentGroupId={group.profileId}
            onSelectProfile={onSelectProfile}
            isEditMode={true}
          />
        </div>
      </div>
      </IonContent>
    </IonPage>
  );
};