Skip to content

Commit 1ebe2ec

Browse files
author
salim laimeche
committed
Fix import order and remove unused code
1 parent d34b489 commit 1ebe2ec

File tree

3 files changed

+41
-59
lines changed

3 files changed

+41
-59
lines changed

components/Login.tsx

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from "next/link"
44
import { Input } from "./ui/input"
55
import { Button } from "./ui/button"
66
import { z } from "zod"
7-
import { LoginFormSchema } from "@/app/lib/identity/definition"
7+
88
import { zodResolver } from "@hookform/resolvers/zod"
99
import { useState } from "react"
1010
import { useRouter } from "next/navigation"
@@ -17,13 +17,14 @@ import {
1717
FormLabel,
1818
FormMessage,
1919
} from "./ui/form"
20-
import { login } from "@/app/lib/identity/auth"
20+
2121
import { AuroraBackground } from "./ui/aurora-background"
2222
import { motion } from "framer-motion"
2323
import { useTheme } from "next-themes"
2424
import { Meteors } from "./ui/meteors"
25-
import { TextGenerateEffect } from "./ui/text-generate-effect"
2625
import { BlurIn } from "./ui/text-blur"
26+
import { login } from "@/app/lib/identity/auth"
27+
import { LoginFormSchema } from "@/app/lib/identity/definition"
2728

2829
export default function Login() {
2930
const { theme } = useTheme()
@@ -65,7 +66,7 @@ export default function Login() {
6566
onMouseLeave={() => setButtonHover(false)}>
6667
<div className="grid gap-2 text-center">
6768
<BlurIn
68-
text="Pretorian System Security"
69+
text="Pro Pretorian System Solution "
6970
balise="h1"
7071
className={`text-3xl font-bold bg-gradient-to-r from-indigo-500 via-yellow-500 to-indigo-500 inline-block text-transparent bg-clip-text`}
7172
/>{" "}
@@ -84,18 +85,15 @@ export default function Login() {
8485
name="email"
8586
render={({ field }) => (
8687
<FormItem>
87-
<FormLabel
88-
className={theme === "light" ? "text-black" : "text-white"}>
88+
<FormLabel className="text-indigo-500">
8989
<BlurIn text="Email" balise="span" className="text-sm" />
9090
</FormLabel>
9191
<FormControl>
9292
<Input
9393
type="email"
9494
autoComplete="username"
9595
placeholder="Votre email..."
96-
className={
97-
theme === "light" ? "text-black" : "text-white"
98-
}
96+
className="text-indigo-500"
9997
{...field}
10098
/>
10199
</FormControl>
@@ -108,8 +106,7 @@ export default function Login() {
108106
name="password"
109107
render={({ field }) => (
110108
<FormItem>
111-
<FormLabel
112-
className={theme === "light" ? "text-black" : "text-white"}>
109+
<FormLabel className="text-indigo-500">
113110
<BlurIn
114111
text="Mot de passe"
115112
balise="span"
@@ -121,9 +118,7 @@ export default function Login() {
121118
type="password"
122119
autoComplete="new-password"
123120
placeholder="Votre mot de passe..."
124-
className={
125-
theme === "light" ? "text-black" : "text-white"
126-
}
121+
className="text-indigo-500"
127122
{...field}
128123
/>
129124
</FormControl>
@@ -143,10 +138,7 @@ export default function Login() {
143138
</Button>
144139
</form>
145140
</Form>
146-
<div
147-
className={`mt-4 text-center text-sm z-10 ${
148-
theme === "light" ? "text-black" : "text-white"
149-
}`}>
141+
<div className={`mt-4 text-center text-sm z-10 text-indigo-500`}>
150142
<BlurIn text="Vous n'avez pas de compte ?" balise="span" />
151143
<Link href="/register" className="underline ml-1 border ">
152144
<BlurIn text="Inscrivez-vous" balise="span" className="text-sm" />

components/VideoInference.tsx

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,35 @@ export default function VideoInference({ user }: IProps) {
142142
disabled={!model || !videoSrc}>
143143
Traiter la vidéo
144144
</Button>
145+
{/* button to remove video in input and video */}
146+
<Button
147+
variant="destructive"
148+
className="hover:bg-red-500"
149+
onClick={() => {
150+
setVideoSrc(null)
151+
const inputFile = document.getElementById("inputFile")
152+
if (inputFile) {
153+
inputFile.setAttribute("value", "")
154+
}
155+
if (videoRef.current) {
156+
videoRef.current.load()
157+
}
158+
159+
if (canvasRef.current) {
160+
const context = canvasRef.current.getContext("2d")
161+
if (context) {
162+
context.clearRect(
163+
0,
164+
0,
165+
canvasRef.current.width,
166+
canvasRef.current.height
167+
)
168+
}
169+
}
170+
}}
171+
disabled={!videoSrc}>
172+
Vider le lecteur vidéo
173+
</Button>
145174
</div>
146175
</CardContent>
147176
</Card>
@@ -203,7 +232,7 @@ export default function VideoInference({ user }: IProps) {
203232
</Card>
204233
)}
205234

206-
<Card>
235+
{/* <Card>
207236
<CardHeader className="flex flex-row items-start bg-muted/50">
208237
<div className="grid gap-0.5">
209238
<CardTitle className="text-lg">Actions</CardTitle>
@@ -216,7 +245,7 @@ export default function VideoInference({ user }: IProps) {
216245
</Button>
217246
</div>
218247
</CardContent>
219-
</Card>
248+
</Card> */}
220249
</div>
221250
</main>
222251
</div>
@@ -240,40 +269,3 @@ function ChevronDownIcon(props) {
240269
</svg>
241270
)
242271
}
243-
244-
function PlayIcon(props) {
245-
return (
246-
<svg
247-
{...props}
248-
xmlns="http://www.w3.org/2000/svg"
249-
width="24"
250-
height="24"
251-
viewBox="0 0 24 24"
252-
fill="none"
253-
stroke="currentColor"
254-
strokeWidth="2"
255-
strokeLinecap="round"
256-
strokeLinejoin="round">
257-
<polygon points="6 3 20 12 6 21 6 3" />
258-
</svg>
259-
)
260-
}
261-
262-
function XIcon(props) {
263-
return (
264-
<svg
265-
{...props}
266-
xmlns="http://www.w3.org/2000/svg"
267-
width="24"
268-
height="24"
269-
viewBox="0 0 24 24"
270-
fill="none"
271-
stroke="currentColor"
272-
strokeWidth="2"
273-
strokeLinecap="round"
274-
strokeLinejoin="round">
275-
<path d="M18 6 6 18" />
276-
<path d="m6 6 12 12" />
277-
</svg>
278-
)
279-
}

models/model-list.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
export enum ModelComputerVision {
22
COCO_SSD = "Coco SSD",
3-
MOBILE_NET = "Mobile Net",
4-
YOLO = "Yolo",
53
}

0 commit comments

Comments
 (0)