Browse Source

ref(ts): Convert <DebugFileFeature> to typescript (#16691)

Matej Minar 5 years ago
parent
commit
b2a8687cd5
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/sentry/static/sentry/app/components/debugFileFeature.tsx

+ 9 - 4
src/sentry/static/sentry/app/components/debugFileFeature.jsx → src/sentry/static/sentry/app/components/debugFileFeature.tsx

@@ -22,8 +22,13 @@ const FEATURE_TOOLTIPS = {
   ),
   ),
 };
 };
 
 
-function DebugFileFeature({available, feature}) {
-  let icon = null;
+type Props = {
+  feature: 'symtab' | 'debug' | 'unwind' | 'sources';
+  available?: true;
+};
+
+const DebugFileFeature = ({available, feature}: Props) => {
+  let icon: React.ReactNode = null;
 
 
   if (available === true) {
   if (available === true) {
     icon = <Icon type="success" src="icon-checkmark-sm" />;
     icon = <Icon type="success" src="icon-checkmark-sm" />;
@@ -39,14 +44,14 @@ function DebugFileFeature({available, feature}) {
       </Tag>
       </Tag>
     </Tooltip>
     </Tooltip>
   );
   );
-}
+};
 
 
 DebugFileFeature.propTypes = {
 DebugFileFeature.propTypes = {
   available: PropTypes.bool,
   available: PropTypes.bool,
   feature: PropTypes.oneOf(Object.keys(FEATURE_TOOLTIPS)).isRequired,
   feature: PropTypes.oneOf(Object.keys(FEATURE_TOOLTIPS)).isRequired,
 };
 };
 
 
-const Icon = styled(InlineSvg)`
+const Icon = styled(InlineSvg)<{type: 'error' | 'success'}>`
   color: ${p => p.theme.alert[p.type].iconColor};
   color: ${p => p.theme.alert[p.type].iconColor};
   margin-right: 1ex;
   margin-right: 1ex;
 `;
 `;