add empty label text to JobList
This commit is contained in:
@@ -3,14 +3,15 @@ import { cn } from "@/lib/utils"
|
|||||||
|
|
||||||
export interface JobListProps {
|
export interface JobListProps {
|
||||||
jobs: JobListItemProps[]
|
jobs: JobListItemProps[]
|
||||||
|
emptyLabel?: string
|
||||||
className?: string
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function JobList({ jobs, className }: JobListProps) {
|
export function JobList({ jobs, emptyLabel = "No running jobs.", className }: JobListProps) {
|
||||||
if (jobs.length === 0) {
|
if (jobs.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div className={cn("flex flex-col gap-2", className)}>
|
<div className={cn("flex flex-col gap-2", className)}>
|
||||||
<p className="text-sm text-muted-foreground">No running jobs.</p>
|
<p className="my-4 text-sm text-center text-muted-foreground">{emptyLabel ?? 'No jobs.'}</p>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user