Skip to content

Commit f3ce240

Browse files
authored
Merge pull request #15 from moda20/Feature/add-job-import-and-export-features
2 parents 3d45963 + 8e86d72 commit f3ce240

14 files changed

Lines changed: 736 additions & 24 deletions

package-lock.json

Lines changed: 22 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"recharts": "^2.15.1",
6767
"tailwind-merge": "^2.5.4",
6868
"tailwindcss-animate": "^1.0.7",
69-
"zod": "^3.23.8"
69+
"zod": "^4.1.7"
7070
},
7171
"devDependencies": {
7272
"@testing-library/dom": "^9.3.4",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { Button } from "@/components/ui/button"
2+
import { Trash2Icon } from "lucide-react"
3+
import HoverScreenComponent from "@/components/custom/general/HoverScreenComponent"
4+
import { useCallback, useState } from "react"
5+
6+
export interface ErrorBlockComponentProps {
7+
children: React.ReactNode
8+
hasError?: boolean
9+
onClear?: () => void
10+
}
11+
12+
export default function ErrorBlockComponent({
13+
onClear,
14+
children,
15+
hasError = true,
16+
}: ErrorBlockComponentProps) {
17+
const [visibleBlock, setVisibleBlock] = useState(hasError)
18+
const clearError = useCallback(() => {
19+
setVisibleBlock(false)
20+
onClear?.()
21+
}, [onClear])
22+
23+
return (
24+
visibleBlock && (
25+
<HoverScreenComponent
26+
hoverComponent={
27+
<div
28+
className={"flex flex-col gap-2 items-center justify-center p-2"}
29+
>
30+
<Button variant="outline" size="sm" onClick={clearError}>
31+
<Trash2Icon className="h-4 w-4" /> clear
32+
</Button>
33+
</div>
34+
}
35+
>
36+
<div className="border-destructive border rounded p-2 text-red-400 text-sm bg-background">
37+
{children}
38+
</div>
39+
</HoverScreenComponent>
40+
)
41+
)
42+
}

0 commit comments

Comments
 (0)