mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 22:18:33 +00:00
* refactor(RequestTabs): update tab width calculation and improve styling * refactor: replace close icon implementation with GradientCloseButton and adjust styles * changes: design * fix: failing tests * fixes * fixes: coderabbit * fixes * fixes * gradient color fix --------- Co-authored-by: naman-bruno <naman@usebruno.com> Co-authored-by: Bijin A B <bijin@usebruno.com>
73 lines
2.1 KiB
JavaScript
73 lines
2.1 KiB
JavaScript
import React from 'react';
|
|
import GradientCloseButton from './GradientCloseButton';
|
|
import { IconVariable, IconSettings, IconRun, IconFolder, IconShieldLock } from '@tabler/icons';
|
|
|
|
const SpecialTab = ({ handleCloseClick, type, tabName, handleDoubleClick, hasDraft }) => {
|
|
const getTabInfo = (type, tabName) => {
|
|
switch (type) {
|
|
case 'collection-settings': {
|
|
return (
|
|
<>
|
|
<IconSettings size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">Collection</span>
|
|
</>
|
|
);
|
|
}
|
|
case 'collection-overview': {
|
|
return (
|
|
<>
|
|
<IconSettings size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">Overview</span>
|
|
</>
|
|
);
|
|
}
|
|
case 'security-settings': {
|
|
return (
|
|
<>
|
|
<IconShieldLock size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">Security</span>
|
|
</>
|
|
);
|
|
}
|
|
case 'folder-settings': {
|
|
return (
|
|
<>
|
|
<IconFolder size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">{tabName || 'Folder'}</span>
|
|
</>
|
|
);
|
|
}
|
|
case 'variables': {
|
|
return (
|
|
<>
|
|
<IconVariable size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">Variables</span>
|
|
</>
|
|
);
|
|
}
|
|
case 'collection-runner': {
|
|
return (
|
|
<>
|
|
<IconRun size={14} strokeWidth={1.5} className="text-yellow-600 flex-shrink-0" />
|
|
<span className="ml-1 tab-name">Runner</span>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<div
|
|
className="flex items-baseline tab-label"
|
|
onDoubleClick={handleDoubleClick}
|
|
>
|
|
{getTabInfo(type, tabName)}
|
|
</div>
|
|
<GradientCloseButton hasChanges={hasDraft} onClick={(e) => handleCloseClick(e)} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default SpecialTab;
|