diff --git a/ui/localization/messages/en.json b/ui/localization/messages/en.json
index ed0c995e..dad90921 100644
--- a/ui/localization/messages/en.json
+++ b/ui/localization/messages/en.json
@@ -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",
diff --git a/ui/src/components/extensions/DCPowerControl.tsx b/ui/src/components/extensions/DCPowerControl.tsx
index fb412f5d..3f728a81 100644
--- a/ui/src/components/extensions/DCPowerControl.tsx
+++ b/ui/src/components/extensions/DCPowerControl.tsx
@@ -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()},
]}
/>
diff --git a/ui/src/notifications.tsx b/ui/src/notifications.tsx
index 5158d8d3..257cff14 100644
--- a/ui/src/notifications.tsx
+++ b/ui/src/notifications.tsx
@@ -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) => (
}
message={message}
@@ -47,7 +46,7 @@ const notifications = {
error: (message: string, options?: NotificationOptions) => {
return toast.custom(
- t => (
+ (t: Toast) => (
}
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]);
}