import { GitCommit } from 'lucide-react';
import { useCommitsSource } from '../../sources/useCommitsSource';
import type { GroupConfig } from '../types';
export const commitsGroup: GroupConfig = {
id: 'commits',
heading: 'Commits',
modes: ['mixed', 'commits'],
prefix: { char: '#', mode: 'commits' },
requiresProject: true,
useItems: (ctx) => {
const { items: commits } = useCommitsSource(ctx.projectId, ctx.enabled);
return commits.map((c) => ({
key: `commit-${c.hash}`,
value: `${c.shortHash} ${c.message} ${c.author}`,
onSelect: () => ctx.run(() => ctx.onShowTab?.('git')),
node: (
<>
{c.shortHash}
{c.message}
{c.author}
>
),
}));
},
};