This repository has been archived by the owner on May 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathfeatures.tsx
89 lines (87 loc) · 2.52 KB
/
features.tsx
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { Icon } from '@chakra-ui/react';
import { BsMusicNoteBeamed } from 'react-icons/bs';
import { FaGamepad } from 'react-icons/fa';
import { IoHappy } from 'react-icons/io5';
import { MdAddReaction, MdMessage } from 'react-icons/md';
import { FeaturesConfig } from './types';
import { provider } from '@/config/translations/provider';
import { createI18n } from '@/utils/i18n';
import { useWelcomeMessageFeature } from './example/WelcomeMessageFeature';
import { useMemeFeature } from './example/MemeFeature';
/**
* Support i18n (Localization)
*/
const { T } = createI18n(provider, {
en: {
music: 'Music Player',
'music description': 'Play music in Your Discord Server',
gaming: 'Gaming',
'gaming description': 'Enjoy playing games with your friends',
'reaction role': 'Reaction Role',
'reaction role description': 'Give user a role when clicking on a button',
memes: 'Memes Time',
'memes description': 'Send memes everyday',
},
cn: {
music: '音樂播放器',
'music description': '在您的 Discord 服務器中播放音樂',
gaming: '遊戲',
'gaming description': 'Enjoy playing games with your friends',
'reaction role': '反應角色',
'reaction role description': '單擊按鈕時為用戶賦予角色',
memes: '模因時間',
'memes description': '每天發送模因',
},
});
/**
* Define information for each features
*
* There is an example:
*/
export const features: FeaturesConfig = {
music: {
name: <T text="music" />,
description: <T text="music description" />,
icon: <Icon as={BsMusicNoteBeamed} />,
useRender() {
return {
component: <></>,
onSubmit: () => {},
};
},
},
'welcome-message': {
name: 'Welcome Message',
description: 'Send message when user joined the server',
icon: <Icon as={MdMessage} />,
useRender: useWelcomeMessageFeature,
},
gaming: {
name: <T text="gaming" />,
description: <T text="gaming description" />,
icon: <Icon as={FaGamepad} />,
useRender() {
return {
component: <></>,
onSubmit: () => {},
};
},
},
'reaction-role': {
name: <T text="reaction role" />,
description: <T text="reaction role description" />,
icon: <Icon as={MdAddReaction} />,
useRender() {
return {
component: <></>,
onSubmit: () => {},
};
},
},
meme: {
name: <T text="memes" />,
description: <T text="memes description" />,
icon: <Icon as={IoHappy} />,
useRender: useMemeFeature,
},
};