feat: define Activity interface and centralize type exports for activity logs
This commit is contained in:
parent
26eaaf6d66
commit
37960a9dc5
@ -1,8 +1,8 @@
|
|||||||
import { Head } from '@inertiajs/react';
|
import { Head } from '@inertiajs/react';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { DataTable } from '@/components/data-table';
|
import { DataTable } from '@/components/data-table';
|
||||||
import { useState } from 'react';
|
import { getColumns } from './partials/columns';
|
||||||
import { getColumns, Activity } from './partials/columns';
|
import { Activity } from '@/types';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
activities: Activity[];
|
activities: Activity[];
|
||||||
@ -37,6 +37,7 @@ export default function ActivityLogIndex({ activities }: Props) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
|
showSelection={false}
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@ -1,16 +1,6 @@
|
|||||||
import { ColumnDef } from '@tanstack/react-table';
|
import { ColumnDef } from '@tanstack/react-table';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
|
import { Activity } from '@/types';
|
||||||
export interface Activity {
|
|
||||||
id: number;
|
|
||||||
description: string;
|
|
||||||
module: string;
|
|
||||||
subject_id: number | string | null;
|
|
||||||
causer: string;
|
|
||||||
properties: any;
|
|
||||||
created_at: string;
|
|
||||||
date: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getColumns(): ColumnDef<Activity>[] {
|
export function getColumns(): ColumnDef<Activity>[] {
|
||||||
return [
|
return [
|
||||||
|
|||||||
10
resources/js/types/activity.ts
Normal file
10
resources/js/types/activity.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export interface Activity {
|
||||||
|
id: number;
|
||||||
|
description: string;
|
||||||
|
module: string;
|
||||||
|
subject_id: number | string | null;
|
||||||
|
causer: string;
|
||||||
|
properties: any;
|
||||||
|
created_at: string;
|
||||||
|
date: string;
|
||||||
|
}
|
||||||
@ -7,4 +7,5 @@ export type * from './expense';
|
|||||||
export type * from './payroll';
|
export type * from './payroll';
|
||||||
export type * from './purchase';
|
export type * from './purchase';
|
||||||
export type * from './general-setting';
|
export type * from './general-setting';
|
||||||
|
export type * from './activity';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user