mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
use onPress() with heroui button
This commit is contained in:
parent
8a6fd290c1
commit
5ef41748ca
19 changed files with 42 additions and 42 deletions
|
|
@ -53,7 +53,7 @@ export function ProfileSelector({ projectId, isOpen, onOpenChange, onSelect }: P
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => fetchProfiles(page)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => fetchProfiles(page)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{profiles.length === 0 && <div className="text-gray-600 text-center">No profiles found</div>}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export function ScenarioSelector({ projectId, isOpen, onOpenChange, onSelect }:
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => fetchScenarios(page)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => fetchScenarios(page)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{scenarios.length === 0 && <div className="text-gray-600 text-center">No scenarios found</div>}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export function SimulationSelector({ projectId, isOpen, onOpenChange, onSelect,
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => fetchSimulations(page)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => fetchSimulations(page)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{simulations.length === 0 && <div className="text-gray-600 text-center">No simulations found</div>}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export function WorkflowSelector({ projectId, isOpen, onOpenChange, onSelect }:
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => fetchWorkflows(page)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => fetchWorkflows(page)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{workflows.length === 0 && <div className="text-gray-600 text-center">No workflows found</div>}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export function ThemeToggle() {
|
|||
<Button
|
||||
variant="light"
|
||||
isIconOnly
|
||||
onClick={toggleTheme}
|
||||
onPress={toggleTheme}
|
||||
aria-label="Toggle theme"
|
||||
className="text-foreground"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ export function ApiKeysSection({
|
|||
API keys are used to authenticate requests to the Rowboat API.
|
||||
</p>
|
||||
<Button
|
||||
onClick={handleCreateKey}
|
||||
onPress={handleCreateKey}
|
||||
size="sm"
|
||||
startContent={<PlusIcon className="w-4 h-4" />}
|
||||
variant="flat"
|
||||
|
|
@ -359,7 +359,7 @@ export function SecretSection({
|
|||
size="sm"
|
||||
variant="flat"
|
||||
color="warning"
|
||||
onClick={handleRotateSecret}
|
||||
onPress={handleRotateSecret}
|
||||
isDisabled={loading}
|
||||
>
|
||||
Rotate
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ export function Chat({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
setFetchResponseError(null);
|
||||
}}
|
||||
>
|
||||
|
|
@ -340,7 +340,7 @@ export function Chat({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
setSimulationComplete(true);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export function ComposeBox({
|
|||
size="sm"
|
||||
isIconOnly
|
||||
disabled={disabled}
|
||||
onClick={handleInput}
|
||||
onPress={handleInput}
|
||||
className="bg-default-100"
|
||||
>
|
||||
<CornerDownLeftIcon size={16} />
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ function MockToolCall({
|
|||
>
|
||||
</Textarea>
|
||||
<Button
|
||||
onClick={handleSubmit}
|
||||
onPress={handleSubmit}
|
||||
disabled={generatingResponse}
|
||||
isLoading={generatingResponse}
|
||||
size="sm"
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ function EditProfile({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && profile && (
|
||||
<form ref={formRef} action={handleSubmit} className="flex flex-col gap-2">
|
||||
|
|
@ -214,7 +214,7 @@ function ViewProfile({
|
|||
size="sm"
|
||||
color="danger"
|
||||
variant="flat"
|
||||
onClick={() => setIsDeleteModalOpen(true)}
|
||||
onPress={() => setIsDeleteModalOpen(true)}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
|
|
@ -323,7 +323,7 @@ function NewProfile({
|
|||
</Button>
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
</div>}
|
||||
<form ref={formRef} action={handleSubmit} className="flex flex-col gap-2">
|
||||
<Input
|
||||
|
|
@ -416,7 +416,7 @@ function ProfileList({
|
|||
<h1 className="text-medium font-bold text-gray-800 pb-2 border-b border-gray-200">Profiles</h1>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => router.push(`/projects/${projectId}/test/profiles/new`)}
|
||||
onPress={() => router.push(`/projects/${projectId}/test/profiles/new`)}
|
||||
className="self-end"
|
||||
startContent={<PlusIcon className="w-4 h-4" />}
|
||||
>
|
||||
|
|
@ -428,7 +428,7 @@ function ProfileList({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => setError(null)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => setError(null)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{profiles.length === 0 && <div className="text-gray-600 text-center">No profiles found</div>}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ function NewRun({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
formRef.current?.requestSubmit();
|
||||
}}
|
||||
>
|
||||
|
|
@ -86,7 +86,7 @@ function NewRun({
|
|||
)}
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsWorkflowSelectorOpen(true)}
|
||||
onPress={() => setIsWorkflowSelectorOpen(true)}
|
||||
type="button"
|
||||
>
|
||||
{selectedWorkflow ? "Change" : "Select"} Workflow
|
||||
|
|
@ -96,7 +96,7 @@ function NewRun({
|
|||
<div className="flex flex-col gap-2">
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsSimulationSelectorOpen(true)}
|
||||
onPress={() => setIsSimulationSelectorOpen(true)}
|
||||
type="button"
|
||||
className="self-start"
|
||||
>
|
||||
|
|
@ -338,7 +338,7 @@ function RunList({
|
|||
<h1 className="text-xl font-semibold text-gray-800 dark:text-neutral-200">Test Runs</h1>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => router.push(`/projects/${projectId}/test/runs/new`)}
|
||||
onPress={() => router.push(`/projects/${projectId}/test/runs/new`)}
|
||||
startContent={<PlusIcon className="w-4 h-4" />}
|
||||
>
|
||||
New Run
|
||||
|
|
@ -351,7 +351,7 @@ function RunList({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => setError(null)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => setError(null)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{runs.length === 0 && <div className="text-gray-600 text-center">No test runs found</div>}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function EditScenario({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
formRef.current?.requestSubmit();
|
||||
}}
|
||||
>
|
||||
|
|
@ -187,7 +187,7 @@ function ViewScenario({
|
|||
size="sm"
|
||||
color="danger"
|
||||
variant="flat"
|
||||
onClick={() => setIsDeleteModalOpen(true)}
|
||||
onPress={() => setIsDeleteModalOpen(true)}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
|
|
@ -292,7 +292,7 @@ function NewScenario({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
formRef.current?.requestSubmit();
|
||||
}}
|
||||
>
|
||||
|
|
@ -375,7 +375,7 @@ function ScenarioList({
|
|||
<h1 className="text-medium font-bold text-gray-800 pb-2 border-b border-gray-200">Scenarios</h1>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => router.push(`/projects/${projectId}/test/scenarios/new`)}
|
||||
onPress={() => router.push(`/projects/${projectId}/test/scenarios/new`)}
|
||||
className="self-end"
|
||||
startContent={<PlusIcon className="w-4 h-4" />}
|
||||
>
|
||||
|
|
@ -387,7 +387,7 @@ function ScenarioList({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => setError(null)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => setError(null)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{scenarios.length === 0 && <div className="text-gray-600 text-center">No scenarios found</div>}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ function EditSimulation({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => formRef.current?.requestSubmit()}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && simulation && (
|
||||
<form ref={formRef} action={handleSubmit} className="flex flex-col gap-2">
|
||||
|
|
@ -116,7 +116,7 @@ function EditSimulation({
|
|||
)}
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsScenarioModalOpen(true)}
|
||||
onPress={() => setIsScenarioModalOpen(true)}
|
||||
type="button"
|
||||
>
|
||||
{scenario ? "Change" : "Select"} Scenario
|
||||
|
|
@ -134,7 +134,7 @@ function EditSimulation({
|
|||
{profile && <Button size="sm" variant="bordered" onClick={() => setProfile(null)}>Remove</Button>}
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsProfileModalOpen(true)}
|
||||
onPress={() => setIsProfileModalOpen(true)}
|
||||
type="button"
|
||||
>
|
||||
{profile ? "Change" : "Select"} Profile
|
||||
|
|
@ -291,7 +291,7 @@ function ViewSimulation({
|
|||
size="sm"
|
||||
color="danger"
|
||||
variant="flat"
|
||||
onClick={() => setIsDeleteModalOpen(true)}
|
||||
onPress={() => setIsDeleteModalOpen(true)}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
|
|
@ -438,7 +438,7 @@ function NewSimulation({
|
|||
)}
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsScenarioModalOpen(true)}
|
||||
onPress={() => setIsScenarioModalOpen(true)}
|
||||
type="button"
|
||||
>
|
||||
{scenario ? "Change" : "Select"} Scenario
|
||||
|
|
@ -456,7 +456,7 @@ function NewSimulation({
|
|||
{profile && <Button size="sm" variant="bordered" onClick={() => setProfile(null)}>Remove</Button>}
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => setIsProfileModalOpen(true)}
|
||||
onPress={() => setIsProfileModalOpen(true)}
|
||||
type="button"
|
||||
>
|
||||
{profile ? "Change" : "Select"} Profile
|
||||
|
|
@ -587,7 +587,7 @@ function SimulationList({
|
|||
<h1 className="text-medium font-bold text-gray-800 pb-2 border-b border-gray-200">Simulations</h1>
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={() => router.push(`/projects/${projectId}/test/simulations/new`)}
|
||||
onPress={() => router.push(`/projects/${projectId}/test/simulations/new`)}
|
||||
className="self-end"
|
||||
startContent={<PlusIcon className="w-4 h-4" />}
|
||||
>
|
||||
|
|
@ -599,7 +599,7 @@ function SimulationList({
|
|||
</div>}
|
||||
{error && <div className="bg-red-100 p-2 rounded-md text-red-800 flex items-center gap-2 text-sm">
|
||||
{error}
|
||||
<Button size="sm" color="danger" onClick={() => setError(null)}>Retry</Button>
|
||||
<Button size="sm" color="danger" onPress={() => setError(null)}>Retry</Button>
|
||||
</div>}
|
||||
{!loading && !error && <>
|
||||
{simulationList.length === 0 && <div className="text-gray-600 text-center">No simulation found</div>}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ export function AgentConfig({
|
|||
size="sm"
|
||||
variant="light"
|
||||
className="opacity-0 group-hover:opacity-100 transition-opacity text-gray-500 hover:text-red-500"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
const newSources = agent.ragDataSources?.filter((s) => s !== source);
|
||||
handleUpdate({
|
||||
...agent,
|
||||
|
|
@ -409,7 +409,7 @@ function GenerateInstructionsModal({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
setError(null);
|
||||
handleGenerate();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ function ComposeBox({
|
|||
endContent={<Button
|
||||
size="sm"
|
||||
isIconOnly
|
||||
onClick={handleInput}
|
||||
onPress={handleInput}
|
||||
className="bg-gray-100 dark:bg-gray-800"
|
||||
>
|
||||
<CornerDownLeftIcon size={16} />
|
||||
|
|
@ -464,7 +464,7 @@ function App({
|
|||
<Button
|
||||
size="sm"
|
||||
color="danger"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
setResponseError(null);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ function PreviewModal({
|
|||
{onApply && <Button
|
||||
variant="solid"
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
onApply();
|
||||
onClose();
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ export function ToolConfig({
|
|||
startContent={<svg className="w-6 h-6" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" d="M5 12h14m-7 7V5" />
|
||||
</svg>}
|
||||
onClick={() => {
|
||||
onPress={() => {
|
||||
const newParamName = `param${Object.keys(tool.parameters?.properties || {}).length + 1}`;
|
||||
const newProperties = {
|
||||
...(tool.parameters?.properties || {}),
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ export function WorkflowEditor({
|
|||
<Button
|
||||
variant="bordered"
|
||||
size="sm"
|
||||
onClick={() => handleCloneVersion(state.present.workflow._id)}
|
||||
onPress={() => handleCloneVersion(state.present.workflow._id)}
|
||||
>
|
||||
Clone this version
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ export function WorkflowSelector({
|
|||
<Button
|
||||
color="primary"
|
||||
startContent={<PlusIcon size={16} />}
|
||||
onClick={handleCreateNewVersion}
|
||||
onPress={handleCreateNewVersion}
|
||||
>
|
||||
Create new version
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue