feat: add category
This commit is contained in:
@@ -45,7 +45,7 @@ const TYPE_LABELS: Record<CategoryType, string> = Object.fromEntries(
|
|||||||
// The icon is a direct image-file field on the category (not an image_id ref).
|
// The icon is a direct image-file field on the category (not an image_id ref).
|
||||||
const ICON_KEYS = ["icon", "icon_url"];
|
const ICON_KEYS = ["icon", "icon_url"];
|
||||||
|
|
||||||
export default function MediaCategoriesPage() {
|
export default function CategoriesPage() {
|
||||||
const [typeFilter, setTypeFilter] = useState<CategoryType>("media");
|
const [typeFilter, setTypeFilter] = useState<CategoryType>("media");
|
||||||
const { data, loading, error, reload } = useList<Category>("/categories", {
|
const { data, loading, error, reload } = useList<Category>("/categories", {
|
||||||
type: typeFilter,
|
type: typeFilter,
|
||||||
+9
-5
@@ -33,14 +33,18 @@ export const NAV: NavSection[] = [
|
|||||||
icon: HomeIcon,
|
icon: HomeIcon,
|
||||||
items: [{ href: "/dashboard", label: "خانه" }],
|
items: [{ href: "/dashboard", label: "خانه" }],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "عمومی",
|
||||||
|
icon: TagIcon,
|
||||||
|
items: [
|
||||||
|
{ href: "/dashboard/categories", label: "دستهبندیها" },
|
||||||
|
{ href: "/dashboard/sub-categories", label: "زیردستهها" },
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "رسانهها",
|
label: "رسانهها",
|
||||||
icon: MediaIcon,
|
icon: MediaIcon,
|
||||||
items: [
|
items: [{ href: "/dashboard/media", label: "فهرست رسانهها" }],
|
||||||
{ href: "/dashboard/media", label: "فهرست رسانهها" },
|
|
||||||
{ href: "/dashboard/media/categories", label: "دستهبندیها" },
|
|
||||||
{ href: "/dashboard/media/sub-categories", label: "زیردستهها" },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "موسیقی",
|
label: "موسیقی",
|
||||||
|
|||||||
Generated
+1
-24
@@ -277,30 +277,6 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/core": {
|
|
||||||
"version": "1.10.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
|
||||||
"integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@emnapi/wasi-threads": "1.2.1",
|
|
||||||
"tslib": "^2.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@emnapi/runtime": {
|
|
||||||
"version": "1.10.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
|
|
||||||
"integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@emnapi/wasi-threads": {
|
"node_modules/@emnapi/wasi-threads": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
|
||||||
@@ -3312,6 +3288,7 @@
|
|||||||
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
|
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rtsao/scc": "^1.1.0",
|
"@rtsao/scc": "^1.1.0",
|
||||||
"array-includes": "^3.1.9",
|
"array-includes": "^3.1.9",
|
||||||
|
|||||||
Reference in New Issue
Block a user