23 lines
687 B
TypeScript
23 lines
687 B
TypeScript
import React, { ReactNode } from 'react'
|
|
import BaseIcon from './BaseIcon'
|
|
import { humanize } from '../helpers/humanize';
|
|
|
|
type Props = {
|
|
icon: string
|
|
title: string
|
|
main?: boolean
|
|
children?: ReactNode
|
|
}
|
|
|
|
export default function SectionTitleLineWithButton({ icon, title, main = false, children }: Props) {
|
|
return (
|
|
<section className={`${main ? '' : 'pt-6'} mb-6 flex items-center justify-between`}>
|
|
<div className="flex items-center justify-start">
|
|
{icon && <BaseIcon path={icon} className="mr-3" size="24" />}
|
|
<h1 className={`leading-tight ${main ? 'text-2xl' : 'text-xl'}`}>{humanize(title)}</h1>
|
|
</div>
|
|
{children}
|
|
</section>
|
|
)
|
|
}
|