chore: prettier format pass on branch files
Auto-format all files modified during the documents-hub-split feature branch that were not yet aligned with the project's Prettier config (single quotes, semicolons, trailing commas). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,9 +70,7 @@ export function getInvoiceColumns({
|
||||
id: 'clientName',
|
||||
accessorKey: 'clientName',
|
||||
header: 'Client',
|
||||
cell: ({ getValue }) => (
|
||||
<span className="font-medium">{getValue() as string}</span>
|
||||
),
|
||||
cell: ({ getValue }) => <span className="font-medium">{getValue() as string}</span>,
|
||||
},
|
||||
{
|
||||
id: 'total',
|
||||
@@ -96,10 +94,7 @@ export function getInvoiceColumns({
|
||||
const status = (getValue() as string) ?? 'draft';
|
||||
const colorClass = STATUS_COLORS[status] ?? STATUS_COLORS.draft;
|
||||
return (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={`capitalize text-xs border ${colorClass}`}
|
||||
>
|
||||
<Badge variant="outline" className={`capitalize text-xs border ${colorClass}`}>
|
||||
{status}
|
||||
</Badge>
|
||||
);
|
||||
@@ -111,8 +106,7 @@ export function getInvoiceColumns({
|
||||
header: 'Due Date',
|
||||
cell: ({ row }) => {
|
||||
const due = row.original.dueDate;
|
||||
const isOverdue =
|
||||
row.original.status === 'sent' && due < today;
|
||||
const isOverdue = row.original.status === 'sent' && due < today;
|
||||
return (
|
||||
<span
|
||||
className={`text-sm ${isOverdue ? 'text-red-600 font-medium' : 'text-muted-foreground'}`}
|
||||
@@ -162,18 +156,14 @@ export function getInvoiceColumns({
|
||||
Send
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
{(invoice.status === 'sent' || invoice.status === 'overdue') &&
|
||||
onRecordPayment && (
|
||||
<DropdownMenuItem onClick={() => onRecordPayment(invoice)}>
|
||||
<CreditCard className="mr-2 h-3.5 w-3.5" />
|
||||
Record Payment
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
{(invoice.status === 'sent' || invoice.status === 'overdue') && onRecordPayment && (
|
||||
<DropdownMenuItem onClick={() => onRecordPayment(invoice)}>
|
||||
<CreditCard className="mr-2 h-3.5 w-3.5" />
|
||||
Record Payment
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
{invoice.status === 'draft' && onDelete && (
|
||||
<DropdownMenuItem
|
||||
className="text-destructive"
|
||||
onClick={() => onDelete(invoice)}
|
||||
>
|
||||
<DropdownMenuItem className="text-destructive" onClick={() => onDelete(invoice)}>
|
||||
<Trash2 className="mr-2 h-3.5 w-3.5" />
|
||||
Delete
|
||||
</DropdownMenuItem>
|
||||
|
||||
@@ -12,11 +12,17 @@ interface InvoicePdfPreviewProps {
|
||||
pdfFileId?: string | null;
|
||||
}
|
||||
|
||||
export function InvoicePdfPreview({ invoiceId, pdfFileId: initialPdfFileId }: InvoicePdfPreviewProps) {
|
||||
export function InvoicePdfPreview({
|
||||
invoiceId,
|
||||
pdfFileId: initialPdfFileId,
|
||||
}: InvoicePdfPreviewProps) {
|
||||
const queryClient = useQueryClient();
|
||||
const [pdfFileId, setPdfFileId] = useState(initialPdfFileId);
|
||||
|
||||
const { data: previewData, isLoading: previewLoading } = useQuery<{ url: string; mimeType: string }>({
|
||||
const { data: previewData, isLoading: previewLoading } = useQuery<{
|
||||
url: string;
|
||||
mimeType: string;
|
||||
}>({
|
||||
queryKey: ['file-preview', pdfFileId],
|
||||
queryFn: () => apiFetch(`/api/v1/files/${pdfFileId}/preview`),
|
||||
enabled: !!pdfFileId,
|
||||
@@ -24,7 +30,9 @@ export function InvoicePdfPreview({ invoiceId, pdfFileId: initialPdfFileId }: In
|
||||
|
||||
const regenerateMutation = useMutation({
|
||||
mutationFn: () =>
|
||||
apiFetch<{ data?: { id?: string } }>(`/api/v1/invoices/${invoiceId}/generate-pdf`, { method: 'POST' }),
|
||||
apiFetch<{ data?: { id?: string } }>(`/api/v1/invoices/${invoiceId}/generate-pdf`, {
|
||||
method: 'POST',
|
||||
}),
|
||||
onSuccess: (data) => {
|
||||
const fileId = data?.data?.id;
|
||||
if (fileId) {
|
||||
|
||||
Reference in New Issue
Block a user