Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

1.2 KB
Raw Blame
import { IconTicket } from "@tabler/icons-react";

import { getWidgetIntegrationConfig } from "@homarr/definitions";

import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";

export const { definition, componentLoader } = createWidgetDefinition("mediaReleases", {
  icon: IconTicket,
  supportsAdvancedFocus: true,
  queryKey: [["widget", "mediaRelease"]],
  refetchInterval: null,
  createOptions() {
    return optionsBuilder.from((factory) => ({
      layout: factory.select({
        defaultValue: "backdrop",
        options: [
          {
            value: "backdrop",
            label: (t) => t("widget.mediaReleases.option.layout.option.backdrop.label"),
          },
          {
            value: "poster",
            label: (t) => t("widget.mediaReleases.option.layout.option.poster.label"),
          },
        ],
      }),
      showDescriptionTooltip: factory.switch({
        defaultValue: true,
      }),
      showType: factory.switch({
        defaultValue: true,
      }),
      showSource: factory.switch({
        defaultValue: true,
      }),
    }));
  },
  ...getWidgetIntegrationConfig("mediaReleases"),
}).withDynamicImport(() => import("./component"));