refactored code
This commit is contained in:
1 parent
5ed4c9a8ec
commit
d326361a03
46 files changed
+230
-592
No files matched your search
@@ -2,7 +2,7 @@ import { useState, useMemo } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { ActiveStatusCell } from "@/constants";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
@@ -148,8 +148,7 @@ export function BranchesListPage() {
|
||||
accessorKey: "active",
|
||||
id: "isActive",
|
||||
header: t("branches.fields.isActive", "IŞJEŇ").toUpperCase(),
|
||||
cell: ({ row }) =>
|
||||
row.original.active ? <CheckCircle2 size={18} className="text-emerald-500" /> : <XCircle size={18} className="text-destructive" />,
|
||||
cell: ({ row }) => <ActiveStatusCell active={row.original.active} />,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { ActiveStatusCell } from "@/constants";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Section, InfoRow, MultiLangRow, ViewActions } from "@/components/viewPageComponents";
|
||||
import { useBranchById, useDeleteBranch } from "@/features/branches/hooks/useBranches";
|
||||
@@ -61,7 +61,7 @@ export function BranchViewPage() {
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-2.5 px-4">
|
||||
<span className="text-sm text-muted-foreground">{t("branches.fields.isActive", "Işjeň")}</span>
|
||||
{data.active ? <CheckCircle2 size={18} className="text-emerald-500" /> : <XCircle size={18} className="text-destructive" />}
|
||||
<ActiveStatusCell active={data.active} />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type { ColumnDef, VisibilityState } from "@tanstack/react-table";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { ActiveStatusCell } from "@/constants";
|
||||
import { DeleteDialog } from "@/components/deleteDialog";
|
||||
import { DataTable } from "@/components/dataTable";
|
||||
import { DataTableToolbar } from "@/components/dataTableToolbar";
|
||||
@@ -76,8 +76,7 @@ export function DistrictsListPage() {
|
||||
accessorKey: "active",
|
||||
id: "isActive",
|
||||
header: t("districts.fields.isActive", "IŞJEŇ").toUpperCase(),
|
||||
cell: ({ row }) =>
|
||||
row.original.active ? <CheckCircle2 size={18} className="text-emerald-500" /> : <XCircle size={18} className="text-destructive" />,
|
||||
cell: ({ row }) => <ActiveStatusCell active={row.original.active} />,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { CheckCircle2, XCircle } from "lucide-react";
|
||||
import { ActiveStatusCell } from "@/constants";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Section, InfoRow, MultiLangRow, ViewActions } from "@/components/viewPageComponents";
|
||||
import { useDistrictById, useDeleteDistrict } from "@/features/districts/hooks/useDistricts";
|
||||
@@ -57,7 +57,7 @@ export function DistrictViewPage() {
|
||||
|
||||
<div className="grid grid-cols-[220px_1fr] items-center py-2.5 px-4">
|
||||
<span className="text-sm text-muted-foreground">{t("districts.fields.isActive", "Işjeň")}</span>
|
||||
{data.active ? <CheckCircle2 size={18} className="text-emerald-500" /> : <XCircle size={18} className="text-destructive" />}
|
||||
<ActiveStatusCell active={data.active} />
|
||||
</div>
|
||||
</Section>
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user