File size: 999 Bytes
56b6519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { t } from 'i18next';
import React from 'react';

type TopMenuProps = {
  auditName: string;
  auditType: string;
  onSave: () => void;
  additionalButtons?: React.ReactNode;
};

const TopMenu: React.FC<TopMenuProps> = ({
  auditName,
  auditType,
  onSave,
  additionalButtons,
}) => {
  return (
    <div className="flex justify-between items-center bg-gray-900 p-4 shadow-md">
      <div className="flex items-center space-x-4">
        <h1 className="text-xl font-semibold text-white">{auditName}</h1>
        {auditType ? (
          <span className="text-gray-400">({auditType})</span>
        ) : null}
      </div>

      <div className="flex items-center space-x-4">
        {additionalButtons ? additionalButtons : null}
        <button
          className="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-500"
          onClick={onSave}
          type="button"
        >
          {t('btn.save')}
        </button>
      </div>
    </div>
  );
};

export default TopMenu;