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.

20 lines
653 B
JavaScript

import Router from 'next/router'
import {Button} from '@rmwc/button'
5 years ago
import styles from './actionBar.module.css'
export default function AdminActionBar({title, actions, children}) {
5 years ago
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>
5 years ago
)
}