Responsive
This commit is contained in:
1 parent
ffddef9845
commit
c1c6d97a77
6 files changed
+75
-46
No files matched your search
+21
-16
@@ -9,6 +9,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { Card, CardContent, CardHeader } from '@/components/ui/card';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { DockerIcon } from '../components/icons/DockerIcon';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
function DeleteWithConfirmation({ onDelete, serviceName }: { onDelete: () => void, serviceName: string }) {
|
||||
const [showConfirm, setShowConfirm] = useState(false);
|
||||
@@ -230,16 +231,17 @@ export default function ServiceView() {
|
||||
</Button>
|
||||
|
||||
<Card className="overflow-hidden shadow-sm border-muted/50 rounded-xl">
|
||||
<CardHeader className="bg-muted/10 p-8 space-y-6 flex flex-col md:flex-row items-start md:items-center justify-between gap-6">
|
||||
<div className="flex items-center gap-6">
|
||||
<div className="w-16 h-16 rounded-2xl bg-card border flex items-center justify-center text-primary shadow-sm group-hover:bg-primary/5 transition-colors">
|
||||
{service.type === 'docker' ? <DockerIcon size={32} /> : <Server size={32} />}
|
||||
<CardHeader className="bg-muted/10 p-4 sm:p-8 space-y-6 flex flex-col lg:flex-row items-start lg:items-center justify-between gap-6">
|
||||
<div className="flex items-start sm:items-center gap-4 sm:gap-6 w-full">
|
||||
<div className="w-12 h-12 sm:w-16 sm:h-16 rounded-xl sm:rounded-2xl bg-card border flex items-center justify-center text-primary shadow-sm shrink-0">
|
||||
{service.type === 'docker' ? <DockerIcon size={24} className="sm:hidden" /> : <Server size={24} className="sm:hidden" />}
|
||||
{service.type === 'docker' ? <DockerIcon size={32} className="hidden sm:block" /> : <Server size={32} className="hidden sm:block" />}
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-3 flex-wrap">
|
||||
<div className="space-y-1 sm:space-y-2 min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2 sm:gap-3 flex-wrap">
|
||||
{isEditingName ? (
|
||||
<Input
|
||||
className="h-10 w-72 text-2xl font-bold bg-card border-primary/30"
|
||||
className="h-9 sm:h-10 w-full sm:w-72 text-xl sm:text-2xl font-bold bg-card border-primary/30"
|
||||
value={tempName}
|
||||
onChange={(e) => setTempName(e.target.value)}
|
||||
onBlur={handleSaveName}
|
||||
@@ -250,25 +252,25 @@ export default function ServiceView() {
|
||||
autoFocus
|
||||
/>
|
||||
) : (
|
||||
<h3 className="text-3xl font-bold tracking-tight cursor-pointer hover:text-primary transition-colors flex items-center gap-3 group" onClick={() => { setIsEditingName(true); setTempName(service.name); }}>
|
||||
{service.name}
|
||||
<Pencil size={18} className="opacity-0 group-hover:opacity-40 transition-opacity" />
|
||||
<h3 className="text-xl sm:text-3xl font-bold tracking-tight cursor-pointer hover:text-primary transition-colors flex items-center gap-2 sm:gap-3 group truncate" onClick={() => { setIsEditingName(true); setTempName(service.name); }}>
|
||||
<span className="truncate">{service.name}</span>
|
||||
<Pencil size={16} className="opacity-0 group-hover:opacity-40 transition-opacity shrink-0" />
|
||||
</h3>
|
||||
)}
|
||||
{typeof service.id === 'string' && service.id.startsWith('ephemeral') && !isSaved && (
|
||||
<Badge variant="outline" className="bg-secondary/10 text-secondary border-secondary/20 font-bold px-3 py-1 uppercase tracking-widest text-[10px]">Session Éphémère</Badge>
|
||||
<Badge variant="outline" className="bg-secondary/10 text-secondary border-secondary/20 font-bold px-2 py-0.5 sm:px-3 sm:py-1 uppercase tracking-widest text-[8px] sm:text-[10px]">Session Éphémère</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<p className="text-sm font-mono text-muted-foreground opacity-70 truncate max-w-[200px] md:max-w-md">
|
||||
<div className="flex items-center gap-2 sm:gap-3 overflow-hidden">
|
||||
<p className="text-xs sm:text-sm font-mono text-muted-foreground opacity-70 truncate max-w-full">
|
||||
{service.pathOrContainerId}
|
||||
</p>
|
||||
<Badge variant="outline" className="text-[10px] font-mono opacity-50 uppercase tracking-tighter">ID: {id}</Badge>
|
||||
<Badge variant="outline" className="text-[8px] sm:text-[10px] font-mono opacity-50 uppercase tracking-tighter shrink-0">ID: {id}</Badge>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-4 shrink-0 w-full md:w-auto justify-end">
|
||||
<div className="flex flex-wrap items-center gap-3 sm:gap-4 shrink-0 w-full lg:w-auto justify-start lg:justify-end">
|
||||
{typeof service.id === 'number' && (
|
||||
<DeleteWithConfirmation onDelete={handleDelete} serviceName={service.name} />
|
||||
)}
|
||||
@@ -277,7 +279,10 @@ export default function ServiceView() {
|
||||
<Button
|
||||
variant={isSaved ? "outline" : "default"}
|
||||
size="lg"
|
||||
className={isSaved ? "border-green-500/50 text-green-500 hover:bg-green-500/5 px-8 rounded-2xl" : "bg-blue-700 hover:bg-blue-800 text-white border-none shadow-lg hover:shadow-blue-500/20 transition-all font-semibold px-8 rounded-2xl"}
|
||||
className={cn(
|
||||
"h-10 sm:h-12 px-6 sm:px-8 rounded-xl sm:rounded-2xl transition-all font-semibold w-full sm:w-auto",
|
||||
isSaved ? "border-green-500/50 text-green-500 hover:bg-green-500/5" : "bg-blue-700 hover:bg-blue-800 text-white border-none shadow-lg hover:shadow-blue-500/20"
|
||||
)}
|
||||
onClick={handleSave}
|
||||
disabled={isSaving || isSaved}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user