From 3e39bafca61e1a527a4ffcc8de6635b1ef5c8323 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Wed, 5 Mar 2025 11:02:15 -0500 Subject: [PATCH] types: use types exposed by components --- static/app/components/core/badge/featureBadge.stories.tsx | 8 +++++--- static/app/components/organizations/hybridFilter.tsx | 6 +++--- .../app/views/settings/dynamicSampling/percentInput.tsx | 7 ++----- .../sentryApplicationDashboard/requestLog.tsx | 4 ++-- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/static/app/components/core/badge/featureBadge.stories.tsx b/static/app/components/core/badge/featureBadge.stories.tsx index 5267d78796101e..b09469ce0e2443 100644 --- a/static/app/components/core/badge/featureBadge.stories.tsx +++ b/static/app/components/core/badge/featureBadge.stories.tsx @@ -1,7 +1,9 @@ -import type {ComponentProps} from 'react'; import {Fragment} from 'react'; -import {FeatureBadge} from 'sentry/components/core/badge/featureBadge'; +import { + FeatureBadge, + type FeatureBadgeProps, +} from 'sentry/components/core/badge/featureBadge'; import Matrix from 'sentry/components/stories/matrix'; import SideBySide from 'sentry/components/stories/sideBySide'; import storyBook from 'sentry/stories/storyBook'; @@ -18,7 +20,7 @@ export default storyBook('FeatureBadge', story => { story('Variants', () => ( - > + render={props => ( Feature X diff --git a/static/app/components/organizations/hybridFilter.tsx b/static/app/components/organizations/hybridFilter.tsx index bc9900628dbf12..538b237411f550 100644 --- a/static/app/components/organizations/hybridFilter.tsx +++ b/static/app/components/organizations/hybridFilter.tsx @@ -12,7 +12,7 @@ import type { SelectSection, } from 'sentry/components/compactSelect'; import {CompactSelect} from 'sentry/components/compactSelect'; -import {Checkbox} from 'sentry/components/core/checkbox'; +import {Checkbox, type CheckboxProps} from 'sentry/components/core/checkbox'; import {IconInfo} from 'sentry/icons/iconInfo'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; @@ -42,7 +42,7 @@ export interface HybridFilterProps onChange: (selected: Value[]) => void; value: Value[]; checkboxWrapper?: ( - renderCheckbox: (props: React.ComponentProps) => React.ReactNode + renderCheckbox: (props: CheckboxProps) => React.ReactNode ) => React.ReactNode; /** * Whether to disable the commit action in multiple selection mode. When true, the @@ -174,7 +174,7 @@ export function HybridFilter({ ...option, hideCheck: true, trailingItems: ({isFocused, isSelected, disabled}) => { - function TrailingCheckbox(props: React.ComponentProps) { + function TrailingCheckbox(props: CheckboxProps) { return ( {} - -export const PercentInput = forwardRef( +export const PercentInput = forwardRef( function PercentInput(props, ref) { return ( { }); function ResponseCode({code}: {code: number}) { - let type: React.ComponentProps['type'] = 'error'; + let type: TagProps['type'] = 'error'; if (code <= 399 && code >= 300) { type = 'warning'; } else if (code <= 299 && code >= 100) {