@@ -5,6 +5,7 @@ import { GoogleSearchButton } from "@~/app.ui/button/components/search";
5
5
import { menu_item } from "@~/app.ui/menu" ;
6
6
import { Horizontal_Menu } from "@~/app.ui/menu/components/Horizontal_Menu" ;
7
7
import { hx_urls } from "@~/app.urls" ;
8
+ import type { EmailDomain_Type } from "@~/moncomptepro.lib/email_domain" ;
8
9
import type { MCP_EmailDomain_Type } from "@~/moncomptepro.lib/moncomptepro.d" ;
9
10
import type { get_orginization_domains_dto } from "@~/organizations.repository/get_orginization_domains" ;
10
11
import { match } from "ts-pattern" ;
@@ -75,38 +76,43 @@ async function Add_Domain() {
75
76
) ;
76
77
}
77
78
78
- function TypeToEmoji ( { type } : { type : MCP_EmailDomain_Type } ) {
79
+ function TypeToEmoji ( { type } : { type : EmailDomain_Type } ) {
79
80
return match ( type )
80
- . with ( "verified" , ( ) => (
81
- < span role = "img" aria-label = "vérifié" title = "vérifié" >
82
- ✅
83
- </ span >
84
- ) )
85
81
. with ( "authorized" , ( ) => (
86
82
< span role = "img" aria-label = "autorisé" title = "autorisé" >
87
83
🔓
88
84
</ span >
89
85
) )
90
- . with ( "external" , ( ) => (
91
- < span role = "img" aria-label = "externe" title = "externe" >
92
- ❎
93
- </ span >
94
- ) )
95
86
. with ( "blacklisted" , ( ) => (
96
87
< span role = "img" aria-label = "blacklisté" title = "blacklisté" >
97
88
☠️
98
89
</ span >
99
90
) )
91
+ . with ( "external" , ( ) => (
92
+ < span role = "img" aria-label = "externe" title = "externe" >
93
+ ❎
94
+ </ span >
95
+ ) )
100
96
. with ( "official_contact" , ( ) => (
101
97
< span role = "img" aria-label = "contact officiel" title = "contact officiel" >
102
98
✅
103
99
</ span >
104
100
) )
101
+ . with ( "refused" , ( ) => (
102
+ < span role = "img" aria-label = "postal mail" title = "postal mail" >
103
+ 🚫
104
+ </ span >
105
+ ) )
105
106
. with ( "trackdechets_postal_mail" , ( ) => (
106
107
< span role = "img" aria-label = "postal mail" title = "postal mail" >
107
108
✅
108
109
</ span >
109
110
) )
111
+ . with ( "verified" , ( ) => (
112
+ < span role = "img" aria-label = "vérifié" title = "vérifié" >
113
+ ✅
114
+ </ span >
115
+ ) )
110
116
. otherwise ( ( ) => (
111
117
< span role = "img" aria-label = "inconnu" title = "inconnu" >
112
118
❓
@@ -155,12 +161,6 @@ async function Row_Actions({
155
161
} ) {
156
162
const { id, organization_id } = organization_domain ;
157
163
158
- const hx_delete_domain_props = await hx_urls . organizations [ ":id" ] . domains [
159
- ":domain_id"
160
- ] . $delete ( {
161
- param : { id : organization_id . toString ( ) , domain_id : id . toString ( ) } ,
162
- } ) ;
163
-
164
164
const hx_change_type_props = ( type : MCP_EmailDomain_Type ) =>
165
165
hx_urls . organizations [ ":id" ] . domains [ ":domain_id" ] . $patch ( {
166
166
param : { id : organization_id . toString ( ) , domain_id : id . toString ( ) } ,
@@ -192,7 +192,7 @@ async function Row_Actions({
192
192
</ li >
193
193
< li >
194
194
< button
195
- { ...await hx_delete_domain_props }
195
+ { ...await hx_change_type_props ( "refused" ) }
196
196
class = { menu_item ( ) }
197
197
hx-swap = "none"
198
198
role = "menuitem"
0 commit comments