feat: implement initial categories crud for human-in-the-loop norm builder

This commit is contained in:
2026-06-23 18:02:01 +00:00
parent c0b3d5c68d
commit 9ef50d9dc0
4 changed files with 262 additions and 3 deletions
+18 -2
View File
@@ -6,11 +6,13 @@ import type { AIProvider } from '../types/providers';
interface HeaderProps {
onReset: () => void;
onClearKey: () => void;
onToggleAdmin: () => void;
isAdminView: boolean;
hasKey: boolean;
provider?: AIProvider;
}
export const Header: React.FC<HeaderProps> = ({ onReset, onClearKey, hasKey, provider }) => {
export const Header: React.FC<HeaderProps> = ({ onReset, onClearKey, onToggleAdmin, isAdminView, hasKey, provider }) => {
const { theme, toggleTheme } = useTheme();
const providerColors: Record<AIProvider, string> = {
@@ -64,7 +66,21 @@ export const Header: React.FC<HeaderProps> = ({ onReset, onClearKey, hasKey, pro
title="Iniciar nova análise de certificado"
>
<RefreshIcon className="w-4 h-4" />
<span>Nova Análise</span>
<span className="hidden sm:inline">Nova Análise</span>
</button>
)}
{hasKey && (
<button
onClick={onToggleAdmin}
className={`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-all border ${isAdminView ? 'text-indigo-600 bg-indigo-50 border-indigo-200 dark:text-indigo-300 dark:bg-indigo-900/30 dark:border-indigo-800' : 'text-slate-600 hover:text-indigo-600 hover:bg-indigo-50 dark:text-slate-300 dark:hover:bg-slate-800 border-transparent hover:border-indigo-200 dark:hover:border-indigo-900'}`}
title="Gerenciar Categorias e Normas"
>
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
<span className="hidden sm:inline">Admin</span>
</button>
)}