⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
import { useTranslations } from 'next-intl';
import { cn } from '@/lib/utils';
import type { PulseUnit } from '@/lib/api/endpoints/analytics';
import type { WidgetConfig } from '@/utils/dashboardWidgets';
const UNIT_OPTIONS: PulseUnit[] = ['hour', 'day', 'week'];
export default function PulseWidgetSettings({
config,
onConfigChange,
}: {
config: WidgetConfig;
onConfigChange: (config: WidgetConfig) => void;
}) {
const t = useTranslations('dashboards.pulse');
const unit = config.granularity ?? 'day';
return (
<div className="flex flex-wrap gap-1">
{(['project', 'me'] as const).map((scope) => (
<button
key={scope}
aria-pressed={(config.pulseScope ?? 'project') === scope}
type="button"
onClick={() => onConfigChange({ pulseScope: scope })}
className={cn(
'rounded-md px-2 py-0.5 text-xs',
(config.pulseScope ?? 'project') === scope
? 'bg-secondary font-medium'
: 'text-muted-foreground hover:bg-accent',
)}
>
{t(`scope.${scope}`)}
</button>
))}
{UNIT_OPTIONS.map((option) => (
<button
key={option}
aria-pressed={unit === option}
type="button"
onClick={() => onConfigChange({ granularity: option })}
className={cn(
'rounded-md px-2 py-0.5 text-xs transition-colors',
unit === option
? 'bg-secondary font-medium text-foreground'
: 'text-muted-foreground hover:bg-accent hover:text-foreground',
)}
>
{t(`unit.${option}`)}
</button>
))}
</div>
);
}