Icon refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import DashboardLayout from '../../../layouts/DashboardLayout.astro';
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import Icon from '../../../components/Icon.astro';
|
||||
import { db } from '../../../db';
|
||||
import { invoices, invoiceItems, clients, members, organizations } from '../../../db/schema';
|
||||
import { eq, and } from 'drizzle-orm';
|
||||
@@ -60,7 +60,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<div>
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<a href="/dashboard/invoices" class="btn btn-ghost btn-xs btn-square">
|
||||
<Icon name="heroicons:arrow-left" class="w-4 h-4" />
|
||||
<Icon name="arrow-left" class="w-4 h-4" />
|
||||
</a>
|
||||
<div class={`badge badge-xs ${
|
||||
invoice.status === 'paid' || invoice.status === 'accepted' ? 'badge-success' :
|
||||
@@ -79,7 +79,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/status`}>
|
||||
<input type="hidden" name="status" value="sent" />
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<Icon name="heroicons:paper-airplane" class="w-4 h-4" />
|
||||
<Icon name="paper-airplane" class="w-4 h-4" />
|
||||
Mark Sent
|
||||
</button>
|
||||
</form>
|
||||
@@ -88,7 +88,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/status`}>
|
||||
<input type="hidden" name="status" value="paid" />
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
<Icon name="heroicons:check" class="w-4 h-4" />
|
||||
<Icon name="check" class="w-4 h-4" />
|
||||
Mark Paid
|
||||
</button>
|
||||
</form>
|
||||
@@ -97,7 +97,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/status`}>
|
||||
<input type="hidden" name="status" value="accepted" />
|
||||
<button type="submit" class="btn btn-success btn-sm">
|
||||
<Icon name="heroicons:check" class="w-4 h-4" />
|
||||
<Icon name="check" class="w-4 h-4" />
|
||||
Mark Accepted
|
||||
</button>
|
||||
</form>
|
||||
@@ -105,25 +105,25 @@ const isDraft = invoice.status === 'draft';
|
||||
{(invoice.type === 'quote' && invoice.status === 'accepted') && (
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/convert`}>
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<Icon name="heroicons:document-duplicate" class="w-4 h-4" />
|
||||
<Icon name="document-duplicate" class="w-4 h-4" />
|
||||
Convert to Invoice
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
<div class="dropdown dropdown-end">
|
||||
<div role="button" tabindex="0" class="btn btn-square btn-ghost btn-sm border border-base-200">
|
||||
<Icon name="heroicons:ellipsis-horizontal" class="w-4 h-4" />
|
||||
<Icon name="ellipsis-horizontal" class="w-4 h-4" />
|
||||
</div>
|
||||
<ul tabindex="0" class="dropdown-content z-1 menu p-2 bg-base-100 rounded-box w-52 border border-base-200">
|
||||
<li>
|
||||
<a href={`/dashboard/invoices/${invoice.id}/edit`}>
|
||||
<Icon name="heroicons:pencil-square" class="w-4 h-4" />
|
||||
<Icon name="pencil-square" class="w-4 h-4" />
|
||||
Edit Settings
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/api/invoices/${invoice.id}/generate`} download>
|
||||
<Icon name="heroicons:arrow-down-tray" class="w-4 h-4" />
|
||||
<Icon name="arrow-down-tray" class="w-4 h-4" />
|
||||
Download PDF
|
||||
</a>
|
||||
</li>
|
||||
@@ -132,7 +132,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/status`}>
|
||||
<input type="hidden" name="status" value="void" />
|
||||
<button type="submit" class="text-error">
|
||||
<Icon name="heroicons:x-circle" class="w-4 h-4" />
|
||||
<Icon name="x-circle" class="w-4 h-4" />
|
||||
Void
|
||||
</button>
|
||||
</form>
|
||||
@@ -142,7 +142,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action="/api/invoices/delete" onsubmit="return confirm('Are you sure?');">
|
||||
<input type="hidden" name="id" value={invoice.id} />
|
||||
<button type="submit" class="text-error">
|
||||
<Icon name="heroicons:trash" class="w-4 h-4" />
|
||||
<Icon name="trash" class="w-4 h-4" />
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
@@ -236,7 +236,7 @@ const isDraft = invoice.status === 'draft';
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/items/delete`}>
|
||||
<input type="hidden" name="itemId" value={item.id} />
|
||||
<button type="submit" class="btn btn-ghost btn-xs btn-square text-error opacity-50 hover:opacity-100">
|
||||
<Icon name="heroicons:trash" class="w-4 h-4" />
|
||||
<Icon name="trash" class="w-4 h-4" />
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@@ -259,7 +259,7 @@ const isDraft = invoice.status === 'draft';
|
||||
{isDraft && (
|
||||
<div class="flex justify-end mb-4">
|
||||
<button onclick="document.getElementById('import_time_modal').showModal()" class="btn btn-sm btn-outline gap-2">
|
||||
<Icon name="heroicons:clock" class="w-4 h-4" />
|
||||
<Icon name="clock" class="w-4 h-4" />
|
||||
Import Time
|
||||
</button>
|
||||
</div>
|
||||
@@ -281,7 +281,7 @@ const isDraft = invoice.status === 'draft';
|
||||
</div>
|
||||
<div class="sm:col-span-1">
|
||||
<button type="submit" class="btn btn-sm btn-primary w-full">
|
||||
<Icon name="heroicons:plus" class="w-4 h-4" />
|
||||
<Icon name="plus" class="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -310,7 +310,7 @@ const isDraft = invoice.status === 'draft';
|
||||
Tax ({invoice.taxRate ?? 0}%)
|
||||
{isDraft && (
|
||||
<button type="button" onclick="document.getElementById('tax_modal').showModal()" class="btn btn-ghost btn-xs btn-square opacity-0 group-hover:opacity-100 transition-opacity" title="Edit Tax Rate">
|
||||
<Icon name="heroicons:pencil" class="w-3 h-3" />
|
||||
<Icon name="pencil" class="w-3 h-3" />
|
||||
</button>
|
||||
)}
|
||||
</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import DashboardLayout from '../../../../layouts/DashboardLayout.astro';
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import Icon from '../../../../components/Icon.astro';
|
||||
import { db } from '../../../../db';
|
||||
import { invoices, members } from '../../../../db/schema';
|
||||
import { eq, and } from 'drizzle-orm';
|
||||
@@ -48,7 +48,7 @@ const discountValueDisplay = invoice.discountType === 'fixed'
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="mb-6">
|
||||
<a href={`/dashboard/invoices/${invoice.id}`} class="btn btn-ghost btn-xs gap-2 pl-0 hover:bg-transparent text-base-content/60">
|
||||
<Icon name="heroicons:arrow-left" class="w-4 h-4" />
|
||||
<Icon name="arrow-left" class="w-4 h-4" />
|
||||
Back to Invoice
|
||||
</a>
|
||||
<h1 class="text-2xl font-extrabold tracking-tight mt-2">Edit Details</h1>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import DashboardLayout from '../../../layouts/DashboardLayout.astro';
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import Icon from '../../../components/Icon.astro';
|
||||
import StatCard from '../../../components/StatCard.astro';
|
||||
import { db } from '../../../db';
|
||||
import { invoices, clients } from '../../../db/schema';
|
||||
@@ -108,7 +108,7 @@ const getStatusColor = (status: string) => {
|
||||
<p class="text-base-content/60 text-sm mt-1">Manage your billing and estimates</p>
|
||||
</div>
|
||||
<a href="/dashboard/invoices/new" class="btn btn-primary btn-sm">
|
||||
<Icon name="heroicons:plus" class="w-4 h-4" />
|
||||
<Icon name="plus" class="w-4 h-4" />
|
||||
Create New
|
||||
</a>
|
||||
</div>
|
||||
@@ -118,14 +118,14 @@ const getStatusColor = (status: string) => {
|
||||
title="Total Invoices"
|
||||
value={String(yearInvoices.filter(i => i.invoice.type === 'invoice').length)}
|
||||
description={selectedYear === 'current' ? `${currentYear} (YTD)` : String(selectedYear)}
|
||||
icon="heroicons:document-text"
|
||||
icon="document-text"
|
||||
color="text-primary"
|
||||
/>
|
||||
<StatCard
|
||||
title="Open Quotes"
|
||||
value={String(yearInvoices.filter(i => i.invoice.type === 'quote' && i.invoice.status === 'sent').length)}
|
||||
description="Waiting for approval"
|
||||
icon="heroicons:clipboard-document-list"
|
||||
icon="clipboard-document-list"
|
||||
color="text-secondary"
|
||||
/>
|
||||
<StatCard
|
||||
@@ -134,7 +134,7 @@ const getStatusColor = (status: string) => {
|
||||
.filter(i => i.invoice.type === 'invoice' && i.invoice.status === 'paid')
|
||||
.reduce((acc, curr) => acc + curr.invoice.total, 0), 'USD')}
|
||||
description={`Paid invoices (${selectedYear === 'current' ? `${currentYear} YTD` : selectedYear})`}
|
||||
icon="heroicons:currency-dollar"
|
||||
icon="currency-dollar"
|
||||
color="text-success"
|
||||
/>
|
||||
</div>
|
||||
@@ -191,7 +191,7 @@ const getStatusColor = (status: string) => {
|
||||
{(selectedYear !== 'current' || selectedType !== 'all' || selectedStatus !== 'all' || sortBy !== 'date-desc') && (
|
||||
<div class="mt-3">
|
||||
<a href="/dashboard/invoices" class="btn btn-ghost btn-xs">
|
||||
<Icon name="heroicons:x-mark" class="w-3 h-3" />
|
||||
<Icon name="x-mark" class="w-3 h-3" />
|
||||
Clear Filters
|
||||
</a>
|
||||
</div>
|
||||
@@ -260,24 +260,24 @@ const getStatusColor = (status: string) => {
|
||||
<td class="text-right">
|
||||
<div class="dropdown dropdown-end">
|
||||
<div role="button" tabindex="0" class="btn btn-ghost btn-xs btn-square">
|
||||
<Icon name="heroicons:ellipsis-vertical" class="w-4 h-4" />
|
||||
<Icon name="ellipsis-vertical" class="w-4 h-4" />
|
||||
</div>
|
||||
<ul tabindex="0" class="dropdown-content menu p-2 bg-base-100 rounded-box w-52 border border-base-200 z-100">
|
||||
<li>
|
||||
<a href={`/dashboard/invoices/${invoice.id}`}>
|
||||
<Icon name="heroicons:eye" class="w-4 h-4" />
|
||||
<Icon name="eye" class="w-4 h-4" />
|
||||
View Details
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/dashboard/invoices/${invoice.id}/edit`}>
|
||||
<Icon name="heroicons:pencil-square" class="w-4 h-4" />
|
||||
<Icon name="pencil-square" class="w-4 h-4" />
|
||||
Edit
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href={`/api/invoices/${invoice.id}/generate`} download>
|
||||
<Icon name="heroicons:arrow-down-tray" class="w-4 h-4" />
|
||||
<Icon name="arrow-down-tray" class="w-4 h-4" />
|
||||
Download PDF
|
||||
</a>
|
||||
</li>
|
||||
@@ -286,7 +286,7 @@ const getStatusColor = (status: string) => {
|
||||
<form method="POST" action={`/api/invoices/${invoice.id}/status`} class="w-full">
|
||||
<input type="hidden" name="status" value="sent" />
|
||||
<button type="submit" class="w-full justify-start">
|
||||
<Icon name="heroicons:paper-airplane" class="w-4 h-4" />
|
||||
<Icon name="paper-airplane" class="w-4 h-4" />
|
||||
Mark as Sent
|
||||
</button>
|
||||
</form>
|
||||
@@ -297,7 +297,7 @@ const getStatusColor = (status: string) => {
|
||||
<form method="POST" action={`/api/invoices/delete`} onsubmit="return confirm('Are you sure? This action cannot be undone.');" class="w-full">
|
||||
<input type="hidden" name="id" value={invoice.id} />
|
||||
<button type="submit" class="w-full justify-start text-error hover:bg-error/10">
|
||||
<Icon name="heroicons:trash" class="w-4 h-4" />
|
||||
<Icon name="trash" class="w-4 h-4" />
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import DashboardLayout from '../../../layouts/DashboardLayout.astro';
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import Icon from '../../../components/Icon.astro';
|
||||
import { db } from '../../../db';
|
||||
import { clients, invoices, organizations } from '../../../db/schema';
|
||||
import { eq, desc, and } from 'drizzle-orm';
|
||||
@@ -81,7 +81,7 @@ const defaultDueDate = nextMonth.toISOString().split('T')[0];
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="mb-6">
|
||||
<a href="/dashboard/invoices" class="btn btn-ghost btn-xs gap-2 pl-0 hover:bg-transparent text-base-content/60">
|
||||
<Icon name="heroicons:arrow-left" class="w-4 h-4" />
|
||||
<Icon name="arrow-left" class="w-4 h-4" />
|
||||
Back to Invoices
|
||||
</a>
|
||||
<h1 class="text-2xl font-extrabold tracking-tight mt-2">Create New Document</h1>
|
||||
@@ -89,7 +89,7 @@ const defaultDueDate = nextMonth.toISOString().split('T')[0];
|
||||
|
||||
{teamClients.length === 0 ? (
|
||||
<div role="alert" class="alert alert-warning">
|
||||
<Icon name="heroicons:exclamation-triangle" class="w-5 h-5" />
|
||||
<Icon name="exclamation-triangle" class="w-5 h-5" />
|
||||
<div>
|
||||
<h3 class="font-semibold text-sm">No Clients Found</h3>
|
||||
<div class="text-xs">You need to add a client before you can create an invoice or quote.</div>
|
||||
@@ -187,7 +187,7 @@ const defaultDueDate = nextMonth.toISOString().split('T')[0];
|
||||
<a href="/dashboard/invoices" class="btn btn-ghost btn-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
Create Draft
|
||||
<Icon name="heroicons:arrow-right" class="w-4 h-4" />
|
||||
<Icon name="arrow-right" class="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user