Skip to content

Commit 399dfcf

Browse files
authored
ref(u2f): Add missing prop types to u2fEnrolledDetails (#96700)
1 parent f4960b8 commit 399dfcf

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

static/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,18 @@ import PanelItem from 'sentry/components/panels/panelItem';
1616
import {IconClose, IconDelete} from 'sentry/icons';
1717
import {t} from 'sentry/locale';
1818
import {space} from 'sentry/styles/space';
19+
import type {AuthenticatorDevice} from 'sentry/types/auth';
1920

20-
function U2fEnrolledDetails(props: any) {
21+
interface U2fEnrolledDetailsProps {
22+
devices: AuthenticatorDevice[];
23+
id: string;
24+
isEnrolled: boolean;
25+
onRemoveU2fDevice: (device: AuthenticatorDevice) => void;
26+
onRenameU2fDevice: (device: AuthenticatorDevice, deviceName: string) => void;
27+
className?: string;
28+
}
29+
30+
function U2fEnrolledDetails(props: U2fEnrolledDetailsProps) {
2131
const {className, isEnrolled, devices, id, onRemoveU2fDevice, onRenameU2fDevice} =
2232
props;
2333

@@ -37,7 +47,7 @@ function U2fEnrolledDetails(props: any) {
3747
<EmptyMessage>{t('You have not added any U2F devices')}</EmptyMessage>
3848
)}
3949
{hasDevices &&
40-
devices?.map((device: any, i: any) => (
50+
devices?.map((device, i) => (
4151
<Device
4252
key={i}
4353
device={device}
@@ -56,7 +66,14 @@ function U2fEnrolledDetails(props: any) {
5666
);
5767
}
5868

59-
function Device(props: any) {
69+
interface DeviceProps {
70+
device: AuthenticatorDevice;
71+
isLastDevice: boolean;
72+
onRemoveU2fDevice: (device: AuthenticatorDevice) => void;
73+
onRenameU2fDevice: (device: AuthenticatorDevice, deviceName: string) => void;
74+
}
75+
76+
function Device(props: DeviceProps) {
6077
const {device, isLastDevice, onRenameU2fDevice, onRemoveU2fDevice} = props;
6178
const [deviceName, setDeviceName] = useState(device.name);
6279
const [isEditing, setEditting] = useState(false);

0 commit comments

Comments
 (0)