@@ -11,7 +11,7 @@ import {
1111} from "lucide-react" ;
1212
1313import type { WorkspaceInfo } from "../../../app/lib/desktop" ;
14- import { currentLocale , t } from "../../../i18n" ;
14+ import { t } from "../../../i18n" ;
1515import { isSandboxWorkspace } from "../../../app/utils" ;
1616import { Button } from "../../design-system/button" ;
1717
@@ -43,7 +43,6 @@ const displayName = (workspace: WorkspaceInfo, fallback: string): string =>
4343 fallback ;
4444
4545export function SkillDestinationModal ( props : SkillDestinationModalProps ) {
46- const translate = ( key : string ) => t ( key , currentLocale ( ) ) ;
4746 const [ selectedWorkspaceId , setSelectedWorkspaceId ] = useState <
4847 string | null
4948 > ( null ) ;
@@ -72,26 +71,26 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
7271 if ( workspace . workspaceType === "local" ) {
7372 return (
7473 workspace . path ?. trim ( ) ||
75- translate ( "share_skill_destination.local_badge" )
74+ t ( "share_skill_destination.local_badge" )
7675 ) ;
7776 }
7877 return (
7978 workspace . directory ?. trim ( ) ||
8079 workspace . openworkHostUrl ?. trim ( ) ||
8180 workspace . baseUrl ?. trim ( ) ||
8281 workspace . path ?. trim ( ) ||
83- translate ( "share_skill_destination.remote_badge" )
82+ t ( "share_skill_destination.remote_badge" )
8483 ) ;
8584 } ;
8685
8786 const workspaceBadge = ( workspace : WorkspaceInfo ) : string => {
8887 if ( isSandboxWorkspace ( workspace ) ) {
89- return translate ( "share_skill_destination.sandbox_badge" ) ;
88+ return t ( "share_skill_destination.sandbox_badge" ) ;
9089 }
9190 if ( workspace . workspaceType === "remote" ) {
92- return translate ( "share_skill_destination.remote_badge" ) ;
91+ return t ( "share_skill_destination.remote_badge" ) ;
9392 }
94- return translate ( "share_skill_destination.local_badge" ) ;
93+ return t ( "share_skill_destination.local_badge" ) ;
9594 } ;
9695
9796 const workspaceCircleClass = (
@@ -126,7 +125,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
126125 < div className = "min-w-0 space-y-3" >
127126 < div className = "inline-flex items-center gap-2 rounded-full border border-gray-6 bg-gray-2 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.18em] text-gray-10" >
128127 < Sparkles size = { 12 } />
129- { translate ( "share_skill_destination.skill_label" ) }
128+ { t ( "share_skill_destination.skill_label" ) }
130129 </ div >
131130 < div className = "rounded-xl border border-gray-6 bg-gray-2/40 px-4 py-4" >
132131 < div className = "flex items-start gap-3" >
@@ -135,11 +134,11 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
135134 </ div >
136135 < div className = "min-w-0 flex-1" >
137136 < div className = "text-[11px] font-semibold uppercase tracking-[0.18em] text-gray-9" >
138- { translate ( "share_skill_destination.skill_label" ) }
137+ { t ( "share_skill_destination.skill_label" ) }
139138 </ div >
140139 < h3 className = "mt-1 text-lg font-semibold text-gray-12 break-words" >
141140 { props . skill ?. name ??
142- translate ( "share_skill_destination.fallback_skill_name" ) }
141+ t ( "share_skill_destination.fallback_skill_name" ) }
143142 </ h3 >
144143 { props . skill ?. description ?. trim ( ) ? (
145144 < p className = "mt-1 text-sm leading-relaxed text-gray-10 break-words" >
@@ -149,7 +148,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
149148 { props . skill ?. trigger ?. trim ( ) ? (
150149 < div className = "mt-3 inline-flex items-center gap-2 rounded-full border border-gray-6 bg-gray-1 px-3 py-1 text-[11px] text-gray-10" >
151150 < span className = "font-semibold text-gray-12" >
152- { translate ( "share_skill_destination.trigger_label" ) }
151+ { t ( "share_skill_destination.trigger_label" ) }
153152 </ span >
154153 < span className = "font-mono" >
155154 { props . skill . trigger . trim ( ) }
@@ -161,10 +160,10 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
161160 </ div >
162161 < div >
163162 < h4 className = "text-sm font-medium text-gray-12" >
164- { translate ( "share_skill_destination.title" ) }
163+ { t ( "share_skill_destination.title" ) }
165164 </ h4 >
166165 < p className = "mt-1 text-sm leading-relaxed text-gray-10" >
167- { translate ( "share_skill_destination.subtitle" ) }
166+ { t ( "share_skill_destination.subtitle" ) }
168167 </ p >
169168 </ div >
170169 </ div >
@@ -175,7 +174,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
175174 className = { `rounded-full p-2 text-gray-9 transition hover:bg-gray-2 hover:text-gray-12 ${
176175 footerBusy ? "cursor-not-allowed opacity-50" : ""
177176 } `. trim ( ) }
178- aria-label = { translate ( "common.close" ) }
177+ aria-label = { t ( "common.close" ) }
179178 >
180179 < X size = { 18 } />
181180 </ button >
@@ -186,7 +185,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
186185 < div className = "space-y-3" >
187186 < div className = "flex items-center justify-between gap-3" >
188187 < div className = "text-sm font-medium text-gray-12" >
189- { translate ( "share_skill_destination.existing_workers" ) }
188+ { t ( "share_skill_destination.existing_workers" ) }
190189 </ div >
191190 { props . workspaces . length > 0 ? (
192191 < span className = "text-[11px] uppercase tracking-[0.18em] text-gray-9" >
@@ -197,7 +196,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
197196
198197 { props . workspaces . length === 0 ? (
199198 < div className = "rounded-xl border border-dashed border-gray-6 bg-gray-2/20 px-4 py-5 text-sm leading-relaxed text-gray-10" >
200- { translate ( "share_skill_destination.no_workers" ) }
199+ { t ( "share_skill_destination.no_workers" ) }
201200 </ div >
202201 ) : (
203202 < div className = "space-y-2" >
@@ -240,17 +239,15 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
240239 </ div >
241240 { isActive ? (
242241 < span className = "rounded-full bg-gray-3 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-gray-11" >
243- { translate ( "share_skill_destination.current_badge" ) }
242+ { t ( "share_skill_destination.current_badge" ) }
244243 </ span >
245244 ) : null }
246245 < span className = "rounded-full bg-gray-3 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-gray-11" >
247246 { workspaceBadge ( workspace ) }
248247 </ span >
249248 { isSelected ? (
250249 < span className = "rounded-full bg-indigo-3/60 px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-indigo-11" >
251- { translate (
252- "share_skill_destination.selected_badge" ,
253- ) }
250+ { t ( "share_skill_destination.selected_badge" ) }
254251 </ span >
255252 ) : null }
256253 </ div >
@@ -260,9 +257,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
260257 </ div >
261258 { isSelected ? (
262259 < div className = "mt-2 text-xs font-medium text-gray-11" >
263- { translate (
264- "share_skill_destination.selected_hint" ,
265- ) }
260+ { t ( "share_skill_destination.selected_hint" ) }
266261 </ div >
267262 ) : null }
268263 </ div >
@@ -290,7 +285,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
290285 { props . onCreateWorker || props . onConnectRemote ? (
291286 < div className = "space-y-3 border-t border-gray-6 pt-5" >
292287 < div className = "text-sm font-medium text-gray-12" >
293- { translate ( "share_skill_destination.more_options" ) }
288+ { t ( "share_skill_destination.more_options" ) }
294289 </ div >
295290 < div className = "grid gap-3 md:grid-cols-2" >
296291 { props . onCreateWorker ? (
@@ -308,12 +303,10 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
308303 </ div >
309304 < div >
310305 < div className = "text-sm font-semibold text-gray-12" >
311- { translate ( "share_skill_destination.create_worker" ) }
306+ { t ( "share_skill_destination.create_worker" ) }
312307 </ div >
313308 < div className = "mt-1 text-sm text-gray-10" >
314- { translate (
315- "share_skill_destination.create_worker_hint" ,
316- ) }
309+ { t ( "share_skill_destination.create_worker_hint" ) }
317310 </ div >
318311 </ div >
319312 </ div >
@@ -335,12 +328,10 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
335328 </ div >
336329 < div >
337330 < div className = "text-sm font-semibold text-gray-12" >
338- { translate ( "share_skill_destination.connect_remote" ) }
331+ { t ( "share_skill_destination.connect_remote" ) }
339332 </ div >
340333 < div className = "mt-1 text-sm text-gray-10" >
341- { translate (
342- "share_skill_destination.connect_remote_hint" ,
343- ) }
334+ { t ( "share_skill_destination.connect_remote_hint" ) }
344335 </ div >
345336 </ div >
346337 </ div >
@@ -371,7 +362,7 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
371362 onClick = { props . onClose }
372363 disabled = { footerBusy }
373364 >
374- { translate ( "common.cancel" ) }
365+ { t ( "common.cancel" ) }
375366 </ Button >
376367 < Button
377368 variant = "primary"
@@ -381,10 +372,10 @@ export function SkillDestinationModal(props: SkillDestinationModalProps) {
381372 { footerBusy ? (
382373 < span className = "inline-flex items-center gap-2" >
383374 < Loader2 size = { 16 } className = "animate-spin" />
384- { translate ( "share_skill_destination.adding" ) }
375+ { t ( "share_skill_destination.adding" ) }
385376 </ span >
386377 ) : (
387- translate ( "share_skill_destination.add_to_workspace" )
378+ t ( "share_skill_destination.add_to_workspace" )
388379 ) }
389380 </ Button >
390381 </ div >
0 commit comments