react-code-dataset / wp-calypso /apps /design-system-docs /docs /components /packages /wp-components /icon-link /index.tsx
react-code-dataset / wp-calypso /apps /design-system-docs /docs /components /packages /wp-components /icon-link /index.tsx
Download wp-calypso/apps/design-system-docs/docs/components/packages/wp-components/icon-link/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/design-system-docs/docs/components/packages/wp-components/icon-link/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/design-system-docs/docs/components/packages/wp-components/icon-link/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/design-system-docs/docs/components/packages/wp-components/icon-link/index.tsx
502 Bytes
| 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" | |
| /> | |
| ); | |
| }; | |