diff --git a/src/index.css b/src/index.css index 25a0ebc..2ecae5e 100644 --- a/src/index.css +++ b/src/index.css @@ -67,3 +67,7 @@ tbody tr:nth-child(odd) { .rmdp-container { width: 100%; } + +.rowTwoInput { + @apply flex flex-col sm:flex-row sm:gap-5 gap-5; +} diff --git a/src/pages/comments/Details.tsx b/src/pages/comments/Details.tsx new file mode 100644 index 0000000..7009dc9 --- /dev/null +++ b/src/pages/comments/Details.tsx @@ -0,0 +1,175 @@ +import { type FC, useState } from 'react' +import Button from '@/components/Button' +import Switch from '@/components/Switch' +import Input from '@/components/Input' +import { Checkbox } from '@/components/ui/checkbox' +import { TickCircle } from 'iconsax-react' + +const CommentsDetails: FC = () => { + const [isActive, setIsActive] = useState(true) + const [foodSearch, setFoodSearch] = useState('') + const [categorySearch, setCategorySearch] = useState('') + const [selectedFoods, setSelectedFoods] = useState([]) + const [selectedCategories, setSelectedCategories] = useState([]) + + const allFoods = ['پیتزا پپرونی', 'سالاد سزار', 'پاستا', 'همبرگر', 'سوشی'] + const allCategories = ['پیش غذا', 'غذای اصلی', 'دسر', 'نوشیدنی', 'سالاد'] + + const foods = ['همه', ...allFoods] + const categories = ['همه', ...allCategories] + + const filteredFoods = foods.filter(food => { + if (food === 'همه') return true + if (!foodSearch.trim()) return true + return food.includes(foodSearch) + }) + + const filteredCategories = categories.filter(category => { + if (category === 'همه') return true + if (!categorySearch.trim()) return true + return category.includes(categorySearch) + }) + + const handleFoodToggle = (food: string) => { + if (food === 'همه') { + setSelectedFoods(allFoods.length === selectedFoods.length ? [] : allFoods) + } else { + setSelectedFoods(prev => + prev.includes(food) ? prev.filter(f => f !== food) : [...prev, food] + ) + } + } + + const handleCategoryToggle = (category: string) => { + if (category === 'همه') { + setSelectedCategories(allCategories.length === selectedCategories.length ? [] : allCategories) + } else { + setSelectedCategories(prev => + prev.includes(category) ? prev.filter(c => c !== category) : [...prev, category] + ) + } + } + + const commentNumber = '۱۲۳۴۵' + + return ( +
+ +
+

نظر {commentNumber}#

+ +
+
+ {/* Main Content */} +
+ + +
+
+ + + +
+ + + +
+ + +
+ +

+ لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ، و با استفاده از طراحان گرافیک است، چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است، و برای شرایط فعلی تکنولوژی مورد نیاز، و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می‌باشد، کتابهای زیادی در شصت و سه درصد گذشته حال و آینده، شناخت فراوان جامعه و متخصصان را می‌طلبد، تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه‌ای علی الخصوص طراحان خلاقی، و فرهنگ پیشرو در زبان فارسی ایجاد کرد، در این صورت می‌توان امید داشت که تمام و دشواری موجود در ارائه راهکارها، و شرایط سخت تایپ به پایان رسد و زمان مورد نیاز شامل حروفچینی دستاوردهای اصلی، و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد +

+
+
+ + {/* Sidebar */} +
+ +
+ فعال + +
+ +
+
وضعیت نمایش
+ +
+
نمایش در غذاهای
+ setFoodSearch(e.target.value)} + className='mb-3' + /> +
+ {filteredFoods.map((food, index) => ( +
+ handleFoodToggle(food)} + /> + +
+ ))} +
+
+ +
+
نمایش در دسته بندی های
+ setCategorySearch(e.target.value)} + className='mb-3' + /> +
+ {filteredCategories.map((category, index) => ( +
+ handleCategoryToggle(category)} + /> + +
+ ))} +
+
+
+
+
+
+ ) +} + +export default CommentsDetails \ No newline at end of file diff --git a/src/router/Main.tsx b/src/router/Main.tsx index d64479e..964295b 100644 --- a/src/router/Main.tsx +++ b/src/router/Main.tsx @@ -15,6 +15,7 @@ import CreateCustomer from '@/pages/customers/Create' import OrdersList from '@/pages/orders/List' import OrderDetails from '@/pages/orders/Details' import CommentsList from '@/pages/comments/List' +import CommentsDetails from '@/pages/comments/Details' const MainRouter: FC = () => { const { hasSubMenu } = useSharedStore() @@ -41,6 +42,7 @@ const MainRouter: FC = () => { } /> } /> } /> + } />