feat(marketing): Refactor marketing wizard steps and add data collection methods

- Moved all marketing wizard step components to `create/_components` directory
- Added `collectData` static method to each step component for data retrieval
- Reorganized file structure to improve component modularity
- Prepared steps for dynamic data collection in wizard workflow
- Added VSCode settings file for project configuration
- Introduced new CMS-related components and services
- Updated API endpoints and added new query hooks
This commit is contained in:
AmirReza Jamali
2025-11-09 14:53:36 +03:30
parent f9bd7fce4b
commit cdc8cde6a4
26 changed files with 414 additions and 63 deletions
-2
View File
@@ -1,5 +1,3 @@
import Link from "next/link";
import GoogleSigninButton from "../GoogleSigninButton";
import SigninWithPassword from "../SigninWithPassword";
export default function Signin() {
+30
View File
@@ -0,0 +1,30 @@
import { TableCell, TableRow } from "@/components/ui/table";
import { ReactNode } from "react";
interface EmptyListWrapperProps<T> {
list: T[];
emptyMessage: string;
columns: string[];
children: ReactNode;
}
function EmptyListWrapper<T>({
list,
emptyMessage,
columns,
children,
}: EmptyListWrapperProps<T>) {
if (!list.length) {
return (
<TableRow>
<TableCell className="text-center" colSpan={columns.length * 100}>
<h2>{emptyMessage}</h2>
</TableCell>
</TableRow>
);
}
return <>{children}</>;
}
export default EmptyListWrapper;
+39
View File
@@ -0,0 +1,39 @@
"use client";
import EmptyListWrapper from "@/components/HOC/EmptyListWrapper";
import ListHeader from "@/components/ui/ListHeader";
import { Table, TableBody, TableHead } from "@/components/ui/table";
import TableSkeleton from "@/components/ui/TableSkeleton";
import { TableHeader, TableRow } from "../../ui/table";
import useCmsTablePresenter from "./useCmsTablePresenter";
const CmsTable = () => {
const { columns, data, isPending } = useCmsTablePresenter();
return (
<div className="flex flex-col rounded-[10px] bg-white px-7.5 pb-4 pt-7.5 shadow-1 dark:bg-gray-dark dark:shadow-card">
<ListHeader />
<Table>
<TableHeader>
<TableRow className="border-none uppercase [&>th]:text-start">
{columns.map((column) => (
<TableHead key={column} colSpan={100}>
{column}
</TableHead>
))}
</TableRow>
</TableHeader>
{isPending && <TableSkeleton column={columns.length} />}
<TableBody>
<EmptyListWrapper
list={data?.data.cms ?? []}
columns={columns}
emptyMessage="No Cms were found"
>
Hollo
</EmptyListWrapper>
</TableBody>
</Table>
</div>
);
};
export default CmsTable;
@@ -0,0 +1,15 @@
"use client";
import { useGetCmsList } from "@/hooks/queries/useCmsQueries";
const useCmsTablePresenter = () => {
const columns = ["row", "title", "created at"];
const { isPending, data } = useGetCmsList();
return {
columns,
isPending,
data,
};
};
export default useCmsTablePresenter;