first commit
This commit is contained in:
35
components/accueil/WeatherWidget.tsx
Normal file
35
components/accueil/WeatherWidget.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import { Cloud, Sun } from "lucide-react";
|
||||
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
|
||||
|
||||
export default function WeatherWidget() {
|
||||
return (
|
||||
<Card className="bg-gradient-to-br from-primary/10 to-secondary">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Sun className="h-6 w-6 text-primary" />
|
||||
Météo
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-3xl font-bold text-primary">28°C</p>
|
||||
<p className="text-gray-600 mt-1">Ensoleillé</p>
|
||||
</div>
|
||||
<div className="text-6xl">
|
||||
<Sun className="h-16 w-16 text-yellow-400" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-4 flex gap-4 text-sm text-gray-600">
|
||||
<div>
|
||||
<span className="font-semibold">Vent:</span> 15 km/h
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-semibold">Humidité:</span> 75%
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
56
components/accueil/WifiCard.tsx
Normal file
56
components/accueil/WifiCard.tsx
Normal file
@ -0,0 +1,56 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Wifi, Copy, Check } from "lucide-react";
|
||||
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { config } from "@/lib/config";
|
||||
|
||||
export default function WifiCard() {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopyPassword = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(config.wifiPassword);
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
} catch (err) {
|
||||
console.error("Erreur lors de la copie:", err);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Card className="bg-white">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Wifi className="h-6 w-6 text-primary" />
|
||||
Connexion WiFi
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div>
|
||||
<p className="text-sm text-gray-600 mb-1">Nom du réseau</p>
|
||||
<p className="text-lg font-semibold text-primary">{config.wifiName}</p>
|
||||
</div>
|
||||
<Button
|
||||
onClick={handleCopyPassword}
|
||||
className="w-full h-14 text-lg"
|
||||
size="lg"
|
||||
>
|
||||
{copied ? (
|
||||
<>
|
||||
<Check className="mr-2 h-5 w-5" />
|
||||
Mot de passe copié !
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Copy className="mr-2 h-5 w-5" />
|
||||
Copier le mot de passe
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user