title: File importing with Typescript
body: <p>I'm importing the file, but I can't give the type of the file, how can I solve this problem?</p>
  <pre><code>import { capitalize } from &quot;utils&quot;;
  
  import * as Icons from &quot;./&quot;;
  type IconType = {
    name: string;
  };
  const icon = ({ name, ...props }: IconType) =&gt; {
    const newName = capitalize(name);
    if (!Icons[newName]) return null;
  
    const CustomIcon = Icons[newName];
    return &lt;CustomIcon {...props} /&gt;;
  };
  
  export default icon;
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/wCUcb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wCUcb.png" alt="enter image description here" /></a></p>