1+ import * as stylex from '@stylexjs/stylex' ;
12import { useMemo , useState } from 'react' ;
23
34import { Dialog } from '../../components/dialog' ;
5+ import { Icon , IconFrame } from '../../components/icon' ;
46import { Section } from '../../components/section' ;
7+ import { colorVars } from '../../tokens.stylex' ;
58import { fill } from './user-profile-account-section/user-profile-account-section.messages' ;
69import type { UserProfileMenuAction } from './user-profile-action-menu' ;
710import { UserProfileActionMenu } from './user-profile-action-menu' ;
811import { userProfilePasskeysMessages as m } from './user-profile-passkeys-section.messages' ;
912import type { UserProfilePasskey } from './user-profile-passkeys-section.view' ;
1013import { UserProfileRenamePasskeyDialog } from './user-profile-rename-passkey.dialog' ;
11- import { UserProfileSecurityIcon } from './user-profile-security-icon' ;
1214
1315export function UserProfilePasskeyRowView ( {
1416 passkey,
@@ -26,6 +28,10 @@ export function UserProfilePasskeyRowView({
2628 const [ name , setName ] = useState ( passkey . name ) ;
2729 const [ isSaving , setIsSaving ] = useState ( false ) ;
2830 const [ error , setError ] = useState < string > ( ) ;
31+ const description =
32+ passkey . createdAtLabel && passkey . lastUsedAtLabel
33+ ? fill ( m . details , { createdAt : passkey . createdAtLabel , lastUsedAt : passkey . lastUsedAtLabel } )
34+ : passkey . createdAtLabel || passkey . lastUsedAtLabel ;
2935
3036 const onOpenChange = ( nextOpen : boolean ) => {
3137 if ( isSaving ) {
@@ -66,11 +72,22 @@ export function UserProfilePasskeyRowView({
6672 return (
6773 < >
6874 < Section . Item >
69- < UserProfileSecurityIcon name = 'passkey' />
75+ < Section . Media size = 'lg' >
76+ < IconFrame
77+ filled
78+ bordered = { false }
79+ >
80+ < Icon
81+ aria-hidden
82+ name = 'security-passkey'
83+ size = 'md'
84+ xstyle = { styles . icon }
85+ />
86+ </ IconFrame >
87+ </ Section . Media >
7088 < Section . Content >
7189 < Section . Label > { passkey . name } </ Section . Label >
72- { passkey . createdAtLabel ? < Section . Description > { passkey . createdAtLabel } </ Section . Description > : null }
73- { passkey . lastUsedAtLabel ? < Section . Description > { passkey . lastUsedAtLabel } </ Section . Description > : null }
90+ { description ? < Section . Description > { description } </ Section . Description > : null }
7491 </ Section . Content >
7592 { actions . length > 0 ? (
7693 < Section . Actions >
@@ -97,3 +114,9 @@ export function UserProfilePasskeyRowView({
97114 </ >
98115 ) ;
99116}
117+
118+ const styles = stylex . create ( {
119+ icon : {
120+ color : colorVars [ '--cl-color-neutral-faded' ] ,
121+ } ,
122+ } ) ;
0 commit comments