File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { sentenceCase } from 'change-case' ;
5
+
1
6
/**
2
7
* WordPress dependencies
3
8
*/
@@ -82,10 +87,19 @@ export default function usePatternDetails( postType, postId ) {
82
87
( area ) => area . area === record . area
83
88
) ;
84
89
85
- details . push ( {
86
- label : __ ( 'Area' ) ,
87
- value : templatePartArea ?. label || record . area || __ ( 'None' ) ,
88
- } ) ;
90
+ let areaDetailValue = templatePartArea ?. label ;
91
+
92
+ if ( ! areaDetailValue ) {
93
+ areaDetailValue = record . area
94
+ ? sprintf (
95
+ // translators: %s: Sentenced cased template part area e.g: "My custom area".
96
+ __ ( '%s (removed)' ) ,
97
+ sentenceCase ( record . area )
98
+ )
99
+ : __ ( 'None' ) ;
100
+ }
101
+
102
+ details . push ( { label : __ ( 'Area' ) , value : areaDetailValue } ) ;
89
103
}
90
104
91
105
if (
You can’t perform that action at this time.
0 commit comments