import { useActivityTypes, useTranslation } from "@termix/plugin-sdk/frontend"; import { Input } from "@termix/plugin-sdk/ui"; import type { RecentActivityConfig, ActivityType, WidgetEditFormProps, } from "../types.js"; export function RecentActivityEditForm({ config, onChange, }: WidgetEditFormProps) { const { t } = useTranslation(); const activityTypes = useActivityTypes(); const toggleType = (type: ActivityType) => { const next = config.filterTypes.includes(type) ? config.filterTypes.filter((x) => x !== type) : [...config.filterTypes, type]; onChange({ ...config, filterTypes: next }); }; return (
onChange({ ...config, maxItems: Math.max(1, Number(e.target.value)), }) } className="h-8 text-xs" />
{activityTypes.map((type) => ( ))}
{t("homepage.filterTypesHint")}
); }