mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-03 10:31:14 +03:00
add optional action slot to current Frigate+ model summary
This commit is contained in:
parent
f9600cafe3
commit
529645415f
@ -1,3 +1,4 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
import {
|
import {
|
||||||
SettingsGroupCard,
|
SettingsGroupCard,
|
||||||
SplitCardRow,
|
SplitCardRow,
|
||||||
@ -7,15 +8,26 @@ import { useTranslation } from "react-i18next";
|
|||||||
|
|
||||||
type FrigatePlusCurrentModelSummaryProps = {
|
type FrigatePlusCurrentModelSummaryProps = {
|
||||||
plusModel: FrigateConfig["model"]["plus"];
|
plusModel: FrigateConfig["model"]["plus"];
|
||||||
|
action?: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FrigatePlusCurrentModelSummary({
|
export default function FrigatePlusCurrentModelSummary({
|
||||||
plusModel,
|
plusModel,
|
||||||
|
action,
|
||||||
}: FrigatePlusCurrentModelSummaryProps) {
|
}: FrigatePlusCurrentModelSummaryProps) {
|
||||||
const { t } = useTranslation("views/settings");
|
const { t } = useTranslation("views/settings");
|
||||||
|
|
||||||
|
const title = action ? (
|
||||||
|
<div className="flex items-center justify-between gap-3">
|
||||||
|
<span>{t("frigatePlus.cardTitles.currentModel")}</span>
|
||||||
|
{action}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
t("frigatePlus.cardTitles.currentModel")
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsGroupCard title={t("frigatePlus.cardTitles.currentModel")}>
|
<SettingsGroupCard title={title}>
|
||||||
{!plusModel && (
|
{!plusModel && (
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
{t("frigatePlus.modelInfo.noModelLoaded")}
|
{t("frigatePlus.modelInfo.noModelLoaded")}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user