mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 10:30:37 +09:00
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
|
|
import { Pause, Play } from "lucide-react";
|
||
|
|
import { Button } from "@/components/ui/button";
|
||
|
|
|
||
|
|
export function RunButton({
|
||
|
|
onClick,
|
||
|
|
disabled,
|
||
|
|
label = "Run now",
|
||
|
|
size = "sm",
|
||
|
|
}: {
|
||
|
|
onClick: () => void;
|
||
|
|
disabled?: boolean;
|
||
|
|
label?: string;
|
||
|
|
size?: "sm" | "default";
|
||
|
|
}) {
|
||
|
|
return (
|
||
|
|
<Button variant="outline" size={size} onClick={onClick} disabled={disabled}>
|
||
|
|
<Play className="h-3.5 w-3.5 sm:mr-1" />
|
||
|
|
<span className="hidden sm:inline">{label}</span>
|
||
|
|
</Button>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function PauseResumeButton({
|
||
|
|
isPaused,
|
||
|
|
onPause,
|
||
|
|
onResume,
|
||
|
|
disabled,
|
||
|
|
size = "sm",
|
||
|
|
}: {
|
||
|
|
isPaused: boolean;
|
||
|
|
onPause: () => void;
|
||
|
|
onResume: () => void;
|
||
|
|
disabled?: boolean;
|
||
|
|
size?: "sm" | "default";
|
||
|
|
}) {
|
||
|
|
if (isPaused) {
|
||
|
|
return (
|
||
|
|
<Button variant="outline" size={size} onClick={onResume} disabled={disabled}>
|
||
|
|
<Play className="h-3.5 w-3.5 sm:mr-1" />
|
||
|
|
<span className="hidden sm:inline">Resume</span>
|
||
|
|
</Button>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Button variant="outline" size={size} onClick={onPause} disabled={disabled}>
|
||
|
|
<Pause className="h-3.5 w-3.5 sm:mr-1" />
|
||
|
|
<span className="hidden sm:inline">Pause</span>
|
||
|
|
</Button>
|
||
|
|
);
|
||
|
|
}
|