feat(react/dialogs): port clone_to

This commit is contained in:
Elian Doran
2025-08-04 21:17:35 +03:00
parent 18eb704b81
commit aa9ffb8f6b
12 changed files with 171 additions and 171 deletions

View File

@@ -2,16 +2,21 @@ import { ComponentChildren } from "preact";
interface FormGroupProps {
label: string;
title?: string;
className?: string;
children: ComponentChildren;
description?: string;
}
export default function FormGroup({ label, children }: FormGroupProps) {
export default function FormGroup({ label, title, className, children, description }: FormGroupProps) {
return (
<div className="form-group">
<div className={`form-group ${className}`} title={title}>
<label style={{ width: "100%" }}>
{label}
{children}
</label>
{description && <small className="form-text text-muted">{description}</small>}
</div>
);
}

View File

@@ -1,25 +1,17 @@
interface FormTextBoxProps {
name: string;
label: string;
currentValue?: string;
className?: string;
description?: string;
onChange?(newValue: string): void;
}
export default function FormTextBox({ name, label, description, className, currentValue, onChange }: FormTextBoxProps) {
export default function FormTextBox({ name, className, currentValue, onChange }: FormTextBoxProps) {
return (
<div className={className}>
<label>
{label}
<input
type="text"
className="form-control"
name={name}
value={currentValue}
onInput={e => onChange?.(e.currentTarget.value)} />
{description && <small className="form-text text-muted">{description}</small>}
</label>
</div>
<input
type="text"
className={`form-control ${className}`}
name={name}
value={currentValue}
onInput={e => onChange?.(e.currentTarget.value)} />
);
}