refactor: Controller files and names

This commit is contained in:
behnam 2025-03-17 10:39:33 +03:00
parent 86d6b52a39
commit e5e2fd7b59
4 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import {
* Or connect multiple usecases and run them, handle their failure, hydrate and store data in * Or connect multiple usecases and run them, handle their failure, hydrate and store data in
* client state managements. * client state managements.
*/ */
export default function cardController(props: { export default function getCardIcon(props: {
type: "invoices" | "customers" | "pending" | "collected"; type: "invoices" | "customers" | "pending" | "collected";
}) { }) {
const { type } = props; const { type } = props;

View File

@ -1,4 +1,4 @@
import cardController from "@/app/[lang]/dashboard/controller/card.controller"; import getCardIcon from "@/app/[lang]/dashboard/components/server/card-icon";
export function Card({ export function Card({
title, title,
@ -9,7 +9,7 @@ export function Card({
value: number | string; value: number | string;
type: "invoices" | "customers" | "pending" | "collected"; type: "invoices" | "customers" | "pending" | "collected";
}) { }) {
const { Icon } = cardController({ type }); const { Icon } = getCardIcon({ type });
return ( return (
<div className="rounded-xl bg-gray-50 p-2 shadow-sm"> <div className="rounded-xl bg-gray-50 p-2 shadow-sm">

View File

@ -1,9 +1,9 @@
import { Card } from "@/app/[lang]/dashboard/components/server/card"; import { Card } from "@/app/[lang]/dashboard/components/server/card";
import cardsController from "@/app/[lang]/dashboard/controller/cards.controller"; import fetchSummaryInfoController from "@/app/[lang]/dashboard/controller/fetch-summary-info.controller";
export default async function CardWrapper() { export default async function CardWrapper() {
const { customersNumber, invoicesNumber, invoicesSummary } = const { customersNumber, invoicesNumber, invoicesSummary } =
await cardsController(); await fetchSummaryInfoController();
return ( return (
<> <>

View File

@ -7,7 +7,7 @@ import { connection } from "next/server";
* Or connect multiple usecases and run them, handle their failure, hydrate and store data in * Or connect multiple usecases and run them, handle their failure, hydrate and store data in
* client state managements. * client state managements.
*/ */
export default function cardsController() { export default function fetchSummaryInfoController() {
connection(); connection();
return fetchSummaryInfoUsecase(); return fetchSummaryInfoUsecase();
} }