diff --git a/package.json b/package.json index 59c0251..0983ab6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "no-copy-frontend", - "version": "0.5.0", + "version": "0.6.0", "private": true, "scripts": { "dev": "next dev -p 2999", diff --git a/src/app/components/dropDownList.tsx b/src/app/components/dropDownList.tsx index 098c212..e926a1b 100644 --- a/src/app/components/dropDownList.tsx +++ b/src/app/components/dropDownList.tsx @@ -5,6 +5,7 @@ interface DropDownListProps { children: ReactNode; value: string | number; callBack: (value: string) => void; + translatedValue?: string; } interface ChildProps { @@ -14,7 +15,7 @@ interface ChildProps { children?: React.ReactNode; } -export default function DropDownList({ children, value, callBack }: DropDownListProps) { +export default function DropDownList({ children, value, callBack, translatedValue }: DropDownListProps) { const [isOpen, setIsOpen] = useState(false) const dropdownRef = useRef(null) useClickOutside(dropdownRef, () => { @@ -30,8 +31,8 @@ export default function DropDownList({ children, value, callBack }: DropDownList callBack(childValue || ""); setIsOpen(false); }, - className: `flex items-center w-full px-4 py-2 text-sm text-left hover:bg-blue-100 cursor-pointer select-none`, - key: index + className: `flex items-center w-full px-4 py-2 text-sm text-left hover:bg-blue-100 cursor-pointer select-none ${value === childValue ? "font-bold" : ""}`, + key: index, }); } return child; @@ -47,7 +48,7 @@ export default function DropDownList({ children, value, callBack }: DropDownList > - {value} + {translatedValue ? translatedValue : value} ([ { id: 1, fileName: 'image1.jpg', fileType: 'image', violations: 5, checks: 12, lastCheck: 1705267200000 }, // 15.01.2024 - { id: 2, fileName: 'presentation.mp4', fileType: 'video', violations: 2, checks: 8, lastCheck: 1705180800000 }, // 14.01.2024 + { id: 2, fileName: 'prespresentationpresentationprpresentationpresentationesentationentation.mp4', fileType: 'video', violations: 2, checks: 8, lastCheck: 1705180800000 }, // 14.01.2024 { id: 3, fileName: 'song.mp3', fileType: 'audio', violations: 0, checks: 5, lastCheck: 1705094400000 }, // 13.01.2024 { id: 4, fileName: 'photo1.jpg', fileType: 'image', violations: 3, checks: 10, lastCheck: 1705008000000 }, // 12.01.2024 { id: 5, fileName: 'movie.mp4', fileType: 'video', violations: 1, checks: 7, lastCheck: 1704921600000 }, // 11.01.2024 @@ -115,10 +115,10 @@ export default function TanstakFilesTable() { ), cell: ({ row }) => ( -
+
-
{row.original.fileName}
+
{row.original.fileName}
), @@ -245,13 +245,13 @@ export default function TanstakFilesTable() { onClick={() => handleDownload(row.original)} className="px-3 py-1 bg-green-500 text-white rounded hover:bg-green-600 text-sm" > - +
), @@ -336,14 +336,15 @@ export default function TanstakFilesTable() { }); return ( -
+
{/* Фильтры */} -
+
{t('date-filter')}:
{ + value={dateFilter} + translatedValue={(() => { switch (dateFilter) { case 'all': return t('all-dates') @@ -380,18 +381,21 @@ export default function TanstakFilesTable() {
{t('type-filter')}:
{ - switch (typeFilter) { - case 'image': - return t('images') - case 'video': - return t('videos') - case 'audio': - return t('audios') - default: - return t('all-types') - } - })()} + value={typeFilter} + translatedValue={ + (() => { + switch (typeFilter) { + case 'image': + return t('images') + case 'video': + return t('videos') + case 'audio': + return t('audios') + default: + return t('all-types') + } + })() + } callBack={setTypeFilter} >
  • @@ -479,7 +483,7 @@ export default function TanstakFilesTable() { {t('page')}{' '} - {table.getState().pagination.pageIndex + 1} {t('out-of')} {table.getPageCount()} + {table.getState().pagination.pageIndex + 1} {t('out-of')} {table.getPageCount() ? table.getPageCount() : 1} diff --git a/src/app/styles/global-styles.scss b/src/app/styles/global-styles.scss index 1f34179..d50d878 100644 --- a/src/app/styles/global-styles.scss +++ b/src/app/styles/global-styles.scss @@ -147,4 +147,10 @@ border-radius: 20px; box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 20px; } +} + +.tanstak-table { + :where(.divide-gray-200 > tr:last-child) { + border-bottom: 1px solid var(--color-gray-200); + } } \ No newline at end of file diff --git a/src/app/ui/icons/icons.tsx b/src/app/ui/icons/icons.tsx index f06d1c1..8ac182a 100644 --- a/src/app/ui/icons/icons.tsx +++ b/src/app/ui/icons/icons.tsx @@ -1,5 +1,7 @@ /* https://icon-sets.iconify.design/ic/ */ +import { CLIENT_STATIC_FILES_RUNTIME_WEBPACK } from 'next/dist/shared/lib/constants' + export function IconImageFile() { return ( @@ -103,4 +105,18 @@ export function IconNotification() { return ( ) +} + +export function IconFileOpen() { + return ( + + + + ) +} + +export function IconShieldExclamation() { + return ( + + ) } \ No newline at end of file