add useDocuments and load saved documents in DocumentsVault
This commit is contained in:
@@ -12,7 +12,7 @@ import { NEUMORPHISM } from '@/styles/Neumorphism';
|
||||
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
// 'raised' : relief neumorphique complet — dashboards, widgets isolés, peu nombreux à l'écran.
|
||||
// 'flat' : bordure fine, sans ombre — listes/tables denses (perf + lisibilité).
|
||||
variant?: 'raised' | 'flat'|'digged';
|
||||
variant?: 'raised' | 'flat'|'digged'|'prophunt';
|
||||
}
|
||||
|
||||
export const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
||||
@@ -21,11 +21,12 @@ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
||||
ref={ref}
|
||||
className={cn(
|
||||
// Style de base
|
||||
"rounded-3xl border-none transition-[background-color,box-shadow] duration-300 ease-in-out flex flex-col overflow-hidden",
|
||||
"rounded-3xl border-none transition-all duration-300 ease-in-out flex flex-col",
|
||||
"bg-[#e8e8e8] dark:bg-[#1e293b]",
|
||||
// Relief neumorphique (par défaut)
|
||||
variant === 'raised' && [NEUMORPHISM.lightShadow, NEUMORPHISM.darkShadow],
|
||||
variant === 'digged' && [NEUMORPHISM.insetDark, NEUMORPHISM.insetLight],
|
||||
variant === 'prophunt' && [NEUMORPHISM.insetDark, NEUMORPHISM.insetLight,NEUMORPHISM.lightShadowHover,NEUMORPHISM.darkShadowHover],
|
||||
// Variante plate : pas d'ombre, juste une bordure discrète — pour tables/listes denses
|
||||
variant === 'flat' && "border border-black/5 dark:border-white/10",
|
||||
className
|
||||
|
||||
@@ -9,7 +9,7 @@ interface ServiceObjectProps {
|
||||
|
||||
export const ServiceObject: React.FC<ServiceObjectProps> = ({ contract }) => {
|
||||
return (
|
||||
<Card variant= 'digged' className="p-4 rounded-lg border border-slate-100 flex flex-col">
|
||||
<Card variant= 'prophunt' className="p-4 flex flex-col cursor-pointer">
|
||||
<div className='flex flex-row justify-between'>
|
||||
<h3 className="text-sm font-medium text-slate-900">{contract.service_name}</h3>
|
||||
{/* Fonctionne instantanément avec 'Actif', 'En déploiement', 'Suspendu' */}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Sun, Moon } from "lucide-react";
|
||||
import { cn } from "@utils/utils";
|
||||
|
||||
interface ThemeToggleProps {
|
||||
isDark: boolean;
|
||||
toggleTheme: () => void;
|
||||
}
|
||||
|
||||
export function ThemeToggle({ isDark, toggleTheme }: ThemeToggleProps) {
|
||||
|
||||
const lightInset = "shadow-[inset_4px_4px_8px_#c5c5c5,inset_-4px_-4px_8px_#ffffff]";
|
||||
const darkInset = "dark:shadow-[inset_4px_4px_8px_#121926,inset_-4px_-4px_8px_#2a3850]";
|
||||
|
||||
const lightExtrude = "shadow-[3px_3px_6px_#c5c5c5,-3px_-3px_6px_#ffffff]";
|
||||
const darkExtrude = "dark:shadow-[3px_3px_6px_#121926,-3px_-3px_6px_#2a3850]";
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
// 1. On ajoute la transition globale sur le fond du bouton principal
|
||||
className="group relative flex items-center w-20 h-10 rounded-full bg-[#e8e8e8] dark:bg-[#1e293b] outline-none cursor-pointer shrink-0 transition-all duration-300 ease-in-out"
|
||||
aria-label="Basculer le thème"
|
||||
>
|
||||
{/* 2. Le Rail : On s'assure qu'il est bien à 300ms ease-in-out */}
|
||||
<div className={cn(
|
||||
"absolute inset-0 rounded-full transition-all duration-300 ease-in-out",
|
||||
lightInset, darkInset
|
||||
)}></div>
|
||||
|
||||
{/* 3. La Bille : On remplace 'transition-transform duration-500' par la transition globale */}
|
||||
<div className={cn(
|
||||
"absolute left-1 w-8 h-8 rounded-full bg-[#e8e8e8] dark:bg-[#1e293b] z-10 flex items-center justify-center",
|
||||
"transition-all duration-300 ease-in-out", // <-- LA CORRECTION EST ICI
|
||||
lightExtrude, darkExtrude,
|
||||
isDark ? "translate-x-10" : "translate-x-0"
|
||||
)}>
|
||||
|
||||
{/* 4. Les icônes : On les passe aussi à 300ms pour que la rotation suive le mouvement */}
|
||||
<Sun className={cn(
|
||||
"absolute w-4 h-4 text-amber-500 transition-all duration-300 ease-in-out",
|
||||
isDark ? "opacity-0 rotate-90 scale-50" : "opacity-100 rotate-0 scale-100"
|
||||
)} strokeWidth={2.5} />
|
||||
|
||||
<Moon className={cn(
|
||||
"absolute w-4 h-4 text-indigo-400 transition-all duration-300 ease-in-out",
|
||||
isDark ? "opacity-100 rotate-0 scale-100" : "opacity-0 -rotate-90 scale-50"
|
||||
)} strokeWidth={2.5} />
|
||||
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import type { InfrastructureNode } from '@/types/InfrastructureNode';
|
||||
import { StatusBadge } from '@ui/StatusBadge';
|
||||
import { cn } from '@/utils/utils';
|
||||
|
||||
interface UptimeObjectProps {
|
||||
node: InfrastructureNode;
|
||||
@@ -9,24 +10,25 @@ interface UptimeObjectProps {
|
||||
export const UptimeObject: React.FC<UptimeObjectProps> = ({ node }) => {
|
||||
return (
|
||||
// La "key" a été retirée d'ici, elle sera gérée par le parent
|
||||
<div className="py-4 flex items-center justify-between first:pt-0 last:pb-0">
|
||||
|
||||
{/* Infos Serveur */}
|
||||
<div>
|
||||
<p className="font-medium text-slate-900">{node.label}</p>
|
||||
<p className="text-xs text-slate-500 mt-0.5">{node.type}</p>
|
||||
</div>
|
||||
|
||||
{/* Métriques & Badge */}
|
||||
<div className="flex items-center space-x-6">
|
||||
<div className="text-right">
|
||||
<p className="text-xs text-slate-500">SLA</p>
|
||||
<p className="text-sm font-semibold text-slate-900">{node.uptime_sla}</p>
|
||||
</div>
|
||||
|
||||
<StatusBadge status={node.status} />
|
||||
</div>
|
||||
<tr className={cn(
|
||||
"hover:bg-amber-50 dark:hover:bg-slate-900 cursor-pointer transition-all duration-300 ease-in-out",
|
||||
)}>
|
||||
|
||||
</div>
|
||||
{/* Infos Serveur */}
|
||||
<td className='p-2'>
|
||||
<p className="font-medium text-slate-900 dark:text-slate-400 transition-all duration-300 ease-in-out">{node.label}</p>
|
||||
<p className="text-xs text-slate-500 mt-0.5">{node.type}</p>
|
||||
</td>
|
||||
|
||||
{/* Métriques & Badge */}
|
||||
<td className='p-2'>
|
||||
<p className="text-xs text-slate-500">SLA</p>
|
||||
<p className="text-sm font-semibold text-slate-900 dark:text-slate-400 transition-all duration-300 ease-in-out">{node.uptime_sla}</p>
|
||||
</td>
|
||||
<td className='text-right p-2'>
|
||||
<StatusBadge status={node.status} />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user