Initial commit
This commit is contained in:
commit
7878e653a0
253 changed files with 24552 additions and 0 deletions
43
src/components/General/Popup/PopupButtons.tsx
Normal file
43
src/components/General/Popup/PopupButtons.tsx
Normal file
|
@ -0,0 +1,43 @@
|
|||
import React from 'react';
|
||||
import 'twin.macro';
|
||||
import ButtonAction from '../../../types/UserInterface/ButtonAction';
|
||||
import ButtonPrimary from '../Styled/ButtonPrimary';
|
||||
import ButtonSecondary from '../Styled/ButtonSecondary';
|
||||
|
||||
export interface PopupButtonsProps {
|
||||
actions: ButtonAction[],
|
||||
}
|
||||
|
||||
export default function PopupButtons({
|
||||
actions,
|
||||
}: PopupButtonsProps) {
|
||||
return (
|
||||
<div
|
||||
tw="flex justify-end px-4 py-2 bg-gray-100 dark:bg-gray-850 border-t dark:border-none"
|
||||
>
|
||||
{actions.map((action) => (
|
||||
action.theme === 'primary'
|
||||
? (
|
||||
<ButtonPrimary
|
||||
key={action.label}
|
||||
type={action.type || 'button'}
|
||||
onClick={() => action.onClick?.()}
|
||||
tw="ml-2 py-1 px-4 rounded"
|
||||
>
|
||||
{action.label}
|
||||
</ButtonPrimary>
|
||||
)
|
||||
: (
|
||||
<ButtonSecondary
|
||||
key={action.label}
|
||||
type={action.type || 'button'}
|
||||
onClick={() => action.onClick?.()}
|
||||
tw="ml-2 py-1 px-4 rounded"
|
||||
>
|
||||
{action.label}
|
||||
</ButtonSecondary>
|
||||
)
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue