memoize alertsbutton and use string for global system alerts set

This commit is contained in:
Henry Dollman
2024-10-19 18:08:02 -04:00
parent 8bf7a0e1d6
commit 7f01d1ec7e
2 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { useState } from 'react'
import { memo, useState } from 'react'
import { useStore } from '@nanostores/react'
import { $alerts, $systems } from '@/lib/stores'
import {
@@ -18,7 +18,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { Checkbox } from '../ui/checkbox'
import { SystemAlert, SystemAlertGlobal } from './alerts-system'
export default function AlertsButton({ system }: { system: SystemRecord }) {
export default memo(function AlertsButton({ system }: { system: SystemRecord }) {
const alerts = useStore($alerts)
const [opened, setOpened] = useState(false)
@@ -47,7 +47,7 @@ export default function AlertsButton({ system }: { system: SystemRecord }) {
</DialogContent>
</Dialog>
)
}
})
function TheContent({
data: { system, alerts, systemAlerts },