Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
1import { useState } from "react";
2import Managed from "@/components/Settings/Manager/AccountManager/Management/Managed";
3import Unmanaged from "@/components/Settings/Manager/AccountManager/Management/Unmanaged";
4import { Button, Modal, Tabs } from "@/components/Shared/UI";
5import AddAccountManager from "./AddAccountManager";
6import Managers from "./Managers";
7
8enum Type {
9 MANAGED = "MANAGED",
10 MANAGERS = "MANAGERS",
11 UNMANAGED = "UNMANAGED"
12}
13
14const AccountManager = () => {
15 const [type, setType] = useState<Type>(Type.MANAGERS);
16 const [showAddManagerModal, setShowAddManagerModal] = useState(false);
17
18 const tabs = [
19 { name: "Managers", type: Type.MANAGERS },
20 { name: "Managed", type: Type.MANAGED },
21 { name: "Un-managed", type: Type.UNMANAGED }
22 ];
23
24 return (
25 <div className="linkify space-y-2">
26 <div className="mx-5 mt-5 flex flex-wrap items-center justify-between gap-5">
27 <Tabs
28 active={type}
29 layoutId="account_manager_tab"
30 setActive={(tabType) => {
31 const nextType = tabType as Type;
32 setType(nextType);
33 }}
34 tabs={tabs}
35 />
36 {type === Type.MANAGERS && (
37 <>
38 <Button onClick={() => setShowAddManagerModal(true)} size="sm">
39 Add manager
40 </Button>
41 <Modal
42 onClose={() => setShowAddManagerModal(false)}
43 show={showAddManagerModal}
44 title="Add Account Manager"
45 >
46 <AddAccountManager
47 setShowAddManagerModal={setShowAddManagerModal}
48 />
49 </Modal>
50 </>
51 )}
52 </div>
53 {type === Type.MANAGERS && <Managers />}
54 {type === Type.MANAGED && <Managed />}
55 {type === Type.UNMANAGED && <Unmanaged />}
56 </div>
57 );
58};
59
60export default AccountManager;