File size: 502 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import { Button } from '@wordpress/components';
import { IconStorybook } from './icon-storybook';
const ICONS = {
storybook: <IconStorybook />,
};
export const IconLink = ( { href, type }: { href: string; type: keyof typeof ICONS } ) => {
return (
<Button
__next40pxDefaultSize
accessibleWhenDisabled
href={ href }
target="_blank"
rel="noreferrer"
icon={ ICONS[ type ] }
label={ `Open in ${ type.charAt( 0 ).toUpperCase() + type.slice( 1 ) }` }
size="compact"
/>
);
};
|