Merge pull request #167 from dlabaj/secondaryActionFix

Fixed build by making secondaryActions optional
This commit is contained in:
mfrances17 2020-10-12 16:47:12 -04:00 committed by GitHub
commit 3d16a021ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ export type ListEmptyStateProps = {
instructions: string;
primaryActionText: string;
onPrimaryAction: MouseEventHandler<HTMLButtonElement>;
secondaryActions: Action[];
secondaryActions?: Action[];
};
export const ListEmptyState = ({
@ -42,17 +42,19 @@ export const ListEmptyState = ({
<Button variant="primary" onClick={onPrimaryAction}>
{primaryActionText}
</Button>
<EmptyStateSecondaryActions>
{secondaryActions.map((action) => (
<Button
key={action.text}
variant={action.type || ButtonVariant.primary}
onClick={action.onClick}
>
{action.text}
</Button>
))}
</EmptyStateSecondaryActions>
{secondaryActions && (
<EmptyStateSecondaryActions>
{secondaryActions.map((action) => (
<Button
key={action.text}
variant={action.type || ButtonVariant.primary}
onClick={action.onClick}
>
{action.text}
</Button>
))}
</EmptyStateSecondaryActions>
)}
</EmptyState>
</>
);