You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import Router from 'next/router'
|
|
|
|
import {Button} from '@rmwc/button'
|
|
|
|
import styles from './actionBar.module.css'
|
|
|
|
|
|
|
|
export default function AdminActionBar({title, actions, children}) {
|
|
|
|
return (
|
|
|
|
<div className={styles.actionBar}>
|
|
|
|
<h2>{title}</h2>
|
|
|
|
{actions && Array.isArray(actions) && actions.map(action => {
|
|
|
|
if(action.url)
|
|
|
|
return <Button outlined onClick={()=>Router.push(action.url)}>{action.label}</Button>
|
|
|
|
if(action.onClick)
|
|
|
|
return <Button outlined onClick={action.onClick}>{action.label}</Button>
|
|
|
|
return <Button outlined>{action.label}</Button>
|
|
|
|
})}
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|