mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 02:26:21 +08:00
Merge pull request #204 from liby/feature/remove-react-fc
chore: remove residual `FC` and `FunctionComponent` from components
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { type FC, useRef } from 'react';
|
||||
import { type ComponentType, useRef } from 'react';
|
||||
import * as uiIcons from '@toeverything/components/icons';
|
||||
import { message, styled } from '@toeverything/components/ui';
|
||||
import { copy } from './copy';
|
||||
|
||||
const IconBooth = ({ name, Icon }: { name: string; Icon: FC<any> }) => {
|
||||
const IconBooth = ({
|
||||
name,
|
||||
Icon,
|
||||
}: {
|
||||
name: string;
|
||||
Icon: ComponentType<any>;
|
||||
}) => {
|
||||
const on_click = () => {
|
||||
copy(`<${name} />`);
|
||||
message.success('Copied ~');
|
||||
@@ -36,7 +42,13 @@ export const Icons = () => {
|
||||
<hr />
|
||||
<IconsContainer>
|
||||
{_icons.map(([key, icon]) => {
|
||||
return <IconBooth key={key} name={key} Icon={icon as FC} />;
|
||||
return (
|
||||
<IconBooth
|
||||
key={key}
|
||||
name={key}
|
||||
Icon={icon as ComponentType<any>}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</IconsContainer>
|
||||
</Container>
|
||||
|
||||
Reference in New Issue
Block a user