37311-vm/frontend/src/components/SectionTitleLineWithButton.tsx
Flatlogic Bot 95aef58de7 v1
2026-01-06 15:05:00 +00:00

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>
)
}