Download wp-calypso/client/dashboard/components/action-list/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/components/action-list/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/components/action-list/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/components/action-list/index.tsx
1.23 kB
| import { | |
| __experimentalVStack as VStack, | |
| __experimentalText as Text, | |
| Card, | |
| CardBody, | |
| } from '@wordpress/components'; | |
| import { forwardRef } from 'react'; | |
| import ActionItem from './action-item'; | |
| import type { ActionListProps } from './types'; | |
| import './style.scss'; | |
| function UnforwardedActionList( | |
| { title, description, children }: ActionListProps, | |
| ref: React.ForwardedRef< HTMLDivElement > | |
| ) { | |
| return ( | |
| <Card className="action-list" ref={ ref }> | |
| <CardBody> | |
| { ( title || description ) && ( | |
| <VStack className="action-list__heading" spacing={ 2 }> | |
| { title && ( | |
| <Text size="15px" weight={ 500 } lineHeight="20px"> | |
| { title } | |
| </Text> | |
| ) } | |
| { description && ( | |
| <Text variant="muted" lineHeight="20px"> | |
| { description } | |
| </Text> | |
| ) } | |
| </VStack> | |
| ) } | |
| <VStack className="action-list__actions" spacing={ 0 }> | |
| { children } | |
| </VStack> | |
| </CardBody> | |
| </Card> | |
| ); | |
| } | |
| export const ActionList = Object.assign( forwardRef( UnforwardedActionList ), { | |
| /** | |
| * Renders a action item inside the `ActionList` component. | |
| */ | |
| ActionItem: Object.assign( ActionItem, { | |
| displayName: 'ActionList.ActionItem', | |
| } ), | |
| } ); | |
| export default ActionList; | |