51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
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>
|
|
</>
|
|
);
|
|
}
|