Skip to content

Commit

Permalink
format: make the code prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 24, 2025
1 parent 8760e38 commit 1cf081c
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 167 deletions.
73 changes: 35 additions & 38 deletions apps/app/app/(routes)/audit/analytic-dailog.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
import {
AlertDialog,
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
AlertDialog,
AlertDialogAction,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { AnalyticsData } from "./page";

export function AnalyicDialog({data}: {data: AnalyticsData}) {
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="default" className="h-7 font-medium">View details</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle className="text-xl">Detailed audit logs</AlertDialogTitle>
<AlertDialogDescription>
Action: {data.action}
</AlertDialogDescription>
<AlertDialogDescription>
Target: {data.target}
</AlertDialogDescription>
<AlertDialogDescription>
Date: {data.date}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogAction>Close</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
)
}


export function AnalyicDialog({ data }: { data: AnalyticsData }) {
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="default" className="h-7 font-medium">
View details
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle className="text-xl">
Detailed audit logs
</AlertDialogTitle>
<AlertDialogDescription>Action: {data.action}</AlertDialogDescription>
<AlertDialogDescription>Target: {data.target}</AlertDialogDescription>
<AlertDialogDescription>Date: {data.date}</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogAction>Close</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}
20 changes: 14 additions & 6 deletions apps/app/app/(routes)/audit/analytics-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface AnalyticsData {
date: string;
}

export default function AnalyticsTable({data}: {data: AnalyticsData[]}) {
export default function AnalyticsTable({ data }: { data: AnalyticsData[] }) {
return (
<Card className="w-full rounded-lg border text-white mt-6 mb-3">
<Table className="">
Expand All @@ -27,15 +27,23 @@ export default function AnalyticsTable({data}: {data: AnalyticsData[]}) {
<TableHead className="text-primary">Action</TableHead>
<TableHead className="text-primary">Target</TableHead>
<TableHead className="text-primary">Date</TableHead>
<TableHead className="text-primary text-right px-9">Actions</TableHead>
<TableHead className="text-primary text-right px-9">
Actions
</TableHead>
</TableRow>
</TableHeader>
<TableBody className="rounded-b-lg">
{data.map((row, index) => (
<TableRow key={index} className="rounded-md">
<TableCell className="text-muted-foreground">{row.action}</TableCell>
<TableCell className="text-muted-foreground">{row.target}</TableCell>
<TableCell className="text-muted-foreground">{row.date}</TableCell>
<TableCell className="text-muted-foreground">
{row.action}
</TableCell>
<TableCell className="text-muted-foreground">
{row.target}
</TableCell>
<TableCell className="text-muted-foreground">
{row.date}
</TableCell>
<TableCell className="text-right">
<AnalyicDialog key={index} data={row} />
</TableCell>
Expand All @@ -45,4 +53,4 @@ export default function AnalyticsTable({data}: {data: AnalyticsData[]}) {
</Table>
</Card>
);
}
}
Loading

0 comments on commit 1cf081c

Please sign in to comment.