Initial commit
This commit is contained in:
50
resources/js/components/EvaluationActions.tsx
Normal file
50
resources/js/components/EvaluationActions.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
import { Button } from "@heroui/react";
|
||||
|
||||
type EvaluationActionsProps = {
|
||||
canStart: boolean;
|
||||
canStartIncremental: boolean;
|
||||
canResume: boolean;
|
||||
canCancel: boolean;
|
||||
actionLoading: boolean;
|
||||
message: string | null;
|
||||
error: string | null;
|
||||
onStart: () => void;
|
||||
onStartIncremental: () => void;
|
||||
onResume: () => void;
|
||||
onCancel: () => void;
|
||||
};
|
||||
|
||||
export default function EvaluationActions({
|
||||
canStart,
|
||||
canStartIncremental,
|
||||
canResume,
|
||||
canCancel,
|
||||
actionLoading,
|
||||
message,
|
||||
error,
|
||||
onStart,
|
||||
onStartIncremental,
|
||||
onResume,
|
||||
onCancel,
|
||||
}: EvaluationActionsProps) {
|
||||
return (
|
||||
<>
|
||||
{message && <div className="text-sm text-green-600">{message}</div>}
|
||||
{error && <div className="text-sm text-red-600">{error}</div>}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button size="sm" onPress={onStart} isDisabled={!canStart} isLoading={actionLoading}>
|
||||
Spustit vyhodnocení
|
||||
</Button>
|
||||
<Button size="sm" variant="flat" onPress={onStartIncremental} isDisabled={!canStartIncremental} isLoading={actionLoading}>
|
||||
Spustit znovu
|
||||
</Button>
|
||||
<Button size="sm" variant="flat" onPress={onResume} isDisabled={!canResume} isLoading={actionLoading}>
|
||||
Pokračovat
|
||||
</Button>
|
||||
<Button size="sm" color="danger" variant="flat" onPress={onCancel} isDisabled={!canCancel} isLoading={actionLoading}>
|
||||
Zrušit
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user