feat(react/dialogs): port delete_notes

This commit is contained in:
Elian Doran
2025-08-05 18:05:41 +03:00
parent a4e6a964c9
commit 87d9ea06f3
13 changed files with 214 additions and 216 deletions

View File

@@ -10,11 +10,16 @@ interface ButtonProps {
keyboardShortcut?: string;
/** Called when the button is clicked. If not set, the button will submit the form (if any). */
onClick?: () => void;
primary?: boolean;
}
export default function Button({ buttonRef: _buttonRef, className, text, onClick, keyboardShortcut, icon }: ButtonProps) {
export default function Button({ buttonRef: _buttonRef, className, text, onClick, keyboardShortcut, icon, primary }: ButtonProps) {
const classes: string[] = ["btn"];
classes.push("btn-primary");
if (primary) {
classes.push("btn-primary");
} else {
classes.push("btn-secondary");
}
if (className) {
classes.push(className);
}

View File

@@ -6,10 +6,11 @@ interface FormCheckboxProps {
*/
hint?: string;
currentValue: boolean;
disabled?: boolean;
onChange(newValue: boolean): void;
}
export default function FormCheckbox({ name, label, currentValue, onChange, hint }: FormCheckboxProps) {
export default function FormCheckbox({ name, disabled, label, currentValue, onChange, hint }: FormCheckboxProps) {
return (
<div className="form-checkbox">
<label
@@ -21,6 +22,7 @@ export default function FormCheckbox({ name, label, currentValue, onChange, hint
name={name}
checked={currentValue || false}
value="1"
disabled={disabled}
onChange={e => onChange((e.target as HTMLInputElement).checked)} />
{label}
</label>

View File

@@ -6,7 +6,7 @@ import type { CSSProperties } from "preact/compat";
interface ModalProps {
className: string;
title: string | ComponentChildren;
size: "lg" | "md" | "sm";
size: "xl" | "lg" | "md" | "sm";
children: ComponentChildren;
footer?: ComponentChildren;
footerAlignment?: "right" | "between";