PR feedback

This commit is contained in:
Marc Brooks 2025-10-07 17:59:07 -05:00
parent 7f3f8694b9
commit 474cb70e80
No known key found for this signature in database
GPG Key ID: 583A6AF2D6AE1DC6
3 changed files with 7 additions and 7 deletions

View File

@ -42,6 +42,7 @@
"dc_power_control_restore_power_state": "Restore Power Loss",
"dc_power_control_power_on_state": "Power ON",
"dc_power_control_power_off_state": "Power OFF",
"dc_power_control_restore_last_state": "Last State",
"dc_power_control_voltage": "Voltage",
"dc_power_control_voltage_unit": "V",
"dc_power_control_current": "Current",

View File

@ -103,7 +103,7 @@ export function DCPowerControl() {
options={[
{ value: '0', label: m.dc_power_control_power_off_state()},
{ value: '1', label: m.dc_power_control_power_on_state()},
{ value: '2', label: m.dc_power_control_restore_power_state() },
{ value: '2', label: m.dc_power_control_restore_last_state()},
]}
/>
</div>

View File

@ -4,7 +4,6 @@ import { CheckCircleIcon, XCircleIcon } from "@heroicons/react/20/solid";
import Card from "@/components/Card";
interface NotificationOptions {
duration?: number;
// Add other options as needed
@ -34,7 +33,7 @@ const ToastContent = ({
const notifications = {
success: (message: string, options?: NotificationOptions) => {
return toast.custom(
t => (
(t: Toast) => (
<ToastContent
icon={<CheckCircleIcon className="w-5 h-5 text-green-500 dark:text-green-400" />}
message={message}
@ -47,7 +46,7 @@ const notifications = {
error: (message: string, options?: NotificationOptions) => {
return toast.custom(
t => (
(t: Toast) => (
<ToastContent
icon={<XCircleIcon className="w-5 h-5 text-red-500 dark:text-red-400" />}
message={message}
@ -64,9 +63,9 @@ function useMaxToasts(max: number) {
useEffect(() => {
toasts
.filter(t => t.visible) // Only consider visible toasts
.filter((_, i) => i >= max) // Is toast index over limit?
.forEach(t => toast.dismiss(t.id)); // Dismiss Use toast.remove(t.id) for no exit animation
.filter((t: Toast) => t.visible) // Only consider visible toasts
.filter((_: Toast, i: number) => i >= max) // Is toast index over limit?
.forEach((t: Toast) => toast.dismiss(t.id)); // Dismiss Use toast.remove(t.id) for no exit animation
}, [toasts, max]);
}