MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / DeleteModal

Function DeleteModal

apps/web/ui/ConfigurationsView/RemoveCommunity/index.tsx:70–126  ·  view source on GitHub ↗
({
  open,
  setOpen,
  communityName,
  setCommunityName,
  currentCommunity,
  onRemoveConfirm,
}: {
  open: boolean;
  setOpen(prop: boolean): void;
  communityName?: string;
  setCommunityName(prop?: string): void;
  currentCommunity: SerializedAccount;
  onRemoveConfirm: () => Promise<void>;
})

Source from the content-addressed store, hash-verified

68}
69
70function DeleteModal({
71 open,
72 setOpen,
73 communityName,
74 setCommunityName,
75 currentCommunity,
76 onRemoveConfirm,
77}: {
78 open: boolean;
79 setOpen(prop: boolean): void;
80 communityName?: string;
81 setCommunityName(prop?: string): void;
82 currentCommunity: SerializedAccount;
83 onRemoveConfirm: () => Promise<void>;
84}) {
85 return (
86 <Modal open={open} close={() => setOpen(false)} size="md">
87 <div className={styles.modalFlexColumnGap4}>
88 <div className={styles.modalTitle}>
89 <H3>Remove Community</H3>
90
91 <div className={styles.modalCloseBtn} onClick={() => setOpen(false)}>
92 <span className="sr-only">Close</span>
93 <FiX />
94 </div>
95 </div>
96 <div className={styles.modalDescription}>
97 <p>
98 Once you delete a community, there is no going back. Please be
99 certain.
100 </p>
101 </div>
102 <TextInput
103 autoFocus
104 id="communityName"
105 label="Please type your community path to confirm deletion"
106 value={communityName}
107 required
108 onChange={(e) => setCommunityName(e.target.value)}
109 />
110 <Button
111 onClick={() => {
112 onRemoveConfirm();
113 }}
114 disabled={communityName !== currentCommunity.slackDomain}
115 color={
116 communityName !== currentCommunity.slackDomain
117 ? 'disabled'
118 : 'danger'
119 }
120 >
121 Delete this community
122 </Button>
123 </div>
124 </Modal>
125 );
126}

Callers

nothing calls this directly

Calls 1

onRemoveConfirmFunction · 0.85

Tested by

no test coverage detected