Files
evidencija-rezija/app/[locale]/home/multi-bill-edit/[year]/[month]/MultiBillEditButton.tsx
Nikola Derežić 0145a2030d feat: add multi-bill-edit page for batch bill status updates
- Add getLocationsByMonth server action with aggregation pipeline to calculate hasAttachment
- Add updateMonth server action for bulk bill status updates with path revalidation
- Create multi-bill-edit page at /home/multi-bill-edit/[year]/[month]
- Implement MultiBillEdit component with toggle functionality for all bills
- Add BillToggleBadge component integration for consistent bill display
- Add "set all as paid/unpaid" toggle button for batch operations
- Implement server-side redirect with success message after save
- Add Suspense boundary with loading skeleton
- Update translations for multi-bill-edit feature (Croatian and English)
- Ensure data freshness with unstable_noStore and revalidatePath

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:45:27 +01:00

26 lines
1.0 KiB
TypeScript

"use client";
import { InboxStackIcon, Square3Stack3DIcon } from '@heroicons/react/24/outline';
import { useTranslations } from 'next-intl';
import { YearMonth } from '../../../../../lib/db-types';
import Link from 'next/link';
export interface MultiBillEditButtonProps {
yearMonth: YearMonth;
}
export const MultiBillEditButton: React.FC<MultiBillEditButtonProps> = ({ yearMonth }) => {
const t = useTranslations("home-page.multi-bill-edit-button");
return (
<div className="card card-compact card-bordered bg-base-100 shadow-s my-1">
<Link href={`/home/multi-bill-edit/${yearMonth.year}/${yearMonth.month}`} className="card-body tooltip self-center" data-tip={t("tooltip")} data-umami-event="add-new-location">
<span className='flex self-center'>
<Square3Stack3DIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
<span className="ml-1 self-center text-xs text-left leading-[1.2em] w-[5.5em]">{t("tooltip")}</span>
</span>
</Link>
</div>
);
};