| 1 | 'use client' |
| 2 | |
| 3 | import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' |
| 4 | import type { CustomFieldDefinition |
| 5 | import { BillingCard } |
| 6 | import { ClientApprovalCard } |
| 7 | import { OrgCustomFieldsCard } |
| 8 | import { DangerZoneCard } |
| 9 | import { GeneralCard } |
| 10 | import { InvoiceFromCard } |
| 11 | import { InvoiceImportDefaultsCard } |
| 12 | import { InvoiceNumberingCard } |
| 13 | import { TimesheetDefaultsCard } |
| 14 | import type { |
| 15 | BillingFrequency, |
| 16 | ClientInvolvementValue, |
| 17 | InvoiceTimeUnit, |
| 18 | TimesheetDuration, |
| 19 | } from './common' |
| 20 | |
| 21 | export function SettingsPageClient({ |
| 22 | organization, |
| 23 | orgSlug, |
| 24 | canDelete, |
| 25 | defaultPayRate, |
| 26 | defaultPayCurrency, |
| 27 | defaultPayFrequency, |
| 28 | defaultBillingRate, |
| 29 | defaultBillingCurrency, |
| 30 | defaultBillingFrequency, |
| 31 | defaultTimesheetDuration, |
| 32 | invoiceNumberTemplate, |
| 33 | invoiceTimeUnit, |
| 34 | invoiceFromName, |
| 35 | invoiceFromAddress, |
| 36 | clientInvolvement, |
| 37 | customFields, |
| 38 | }: { |
| 39 | organization: { |
| 40 | orgSlug: string |
| 41 | canDelete: boolean |
| 42 | defaultPayRate: number |
| 43 | defaultPayCurrency: string |
| 44 | defaultPayFrequency: BillingFrequency |
| 45 | defaultBillingRate: number |
| 46 | defaultBillingCurrency: string |
| 47 | defaultBillingFrequency: BillingFrequency |
| 48 | defaultTimesheetDuration: TimesheetDuration |
| 49 | invoiceNumberTemplate: string |
| 50 | invoiceTimeUnit: InvoiceTimeUnit |
| 51 | invoiceFromName: string |
| 52 | invoiceFromAddress: string |
| 53 | clientInvolvement: ClientInvolvementValue |
| 54 | customFields: CustomFieldDefinition |
| 55 | }) { |
| 56 | return ( |
| 57 | <div className='w-full |
| 58 | <div className='mb-6 |
| 59 | <h1 className='font-semibold text-2xl |
| 60 | </div> |
| 61 | |
| 62 | <Tabs defaultValue=' |
| 63 | <TabsList variant=' |
| 64 | <TabsTrigger value=' |
| 65 | <TabsTrigger value=' |
| 66 | <TabsTrigger value=' |
| 67 | <TabsTrigger value=' |
| 68 | <TabsTrigger value=' |
| 69 | {canDelete && <TabsTrigger |
| 70 | </TabsList> |
| 71 | |
| 72 | <TabsContent className=' |
| 73 | <GeneralCard organization={ |
| 74 | </TabsContent> |
| 75 | |
| 76 | <TabsContent className=' |
| 77 | <TimesheetDefaultsCard |
| 78 | defaultBillingCurrency={defaultBillingCurrency} |
| 79 | defaultBillingFrequency={defaultBillingFrequency} |
| 80 | defaultBillingRate={defaultBillingRate} |
| 81 | defaultPayCurrency={defaultPayCurrency} |
| 82 | defaultPayFrequency={defaultPayFrequency} |
| 83 | defaultPayRate={defaultPayRate} |
| 84 | defaultTimesheetDuration={defaultTimesheetDuration} |
| 85 | organizationId={organization.id |
| 86 | /> |
| 87 | <OrgCustomFieldsCard |
| 88 | customFields={customFields} |
| 89 | organizationId={organization.id |
| 90 | /> |
| 91 | </TabsContent> |
| 92 | |
| 93 | <TabsContent value=' |
| 94 | <ClientApprovalCard |
| 95 | clientInvolvement={clientInvolvement} |
| 96 | organizationId={organization.id |
| 97 | /> |
| 98 | </TabsContent> |
| 99 | |
| 100 | <TabsContent className=' |
| 101 | <InvoiceNumberingCard |
| 102 | invoiceNumberTemplate={invoiceNumberTemplate} |
| 103 | organizationId={organization.id |
| 104 | /> |
| 105 | <InvoiceImportDefaultsCard |
| 106 | invoiceTimeUnit={invoiceTimeUnit} |
| 107 | organizationId={organization.id |
| 108 | /> |
| 109 | <InvoiceFromCard |
| 110 | invoiceFromAddress={invoiceFromAddress} |
| 111 | invoiceFromName={invoiceFromName} |
| 112 | organizationId={organization.id |
| 113 | /> |
| 114 | </TabsContent> |
| 115 | |
| 116 | <TabsContent value=' |
| 117 | <BillingCard /> |
| 118 | </TabsContent> |
| 119 | |
| 120 | {canDelete && ( |
| 121 | <TabsContent value=' |
| 122 | <DangerZoneCard organization={ |
| 123 | </TabsContent> |
| 124 | )} |
| 125 | </Tabs> |
| 126 | </div> |
| 127 | ) |
| 128 | } |