Refactor components to enhance code clarity and maintainability by updating prop types to use Readonly for better immutability. Adjust Result class methods for consistency, and streamline query functions in ChannelDetail and other components to improve performance and readability.
ci / build-backend (push) Successful in 1m41s
ci / build-frontend (push) Successful in 47s
ci / tests (push) Successful in 2m40s
ci / sonar (push) Successful in 5m35s

This commit is contained in:
Leonid Pershin
2026-07-27 01:14:53 +03:00
parent ecb5417170
commit 5449c05b5b
56 changed files with 132 additions and 124 deletions
@@ -45,7 +45,7 @@ function formatSize(bytes: number): string {
* Номера сезона и серии распознаются здесь же и в таком виде и уходят на сервер: что показано,
* то и сохранится.
*/
export function ManualInboxDialog({ onClose }: { onClose: () => void }) {
export function ManualInboxDialog({ onClose }: Readonly<{ onClose: () => void }>) {
const { t } = useTranslation()
const queryClient = useQueryClient()
const [selected, setSelected] = useState<string[]>([])
@@ -261,7 +261,7 @@ export function MediaPanel() {
)
}
function MediaRow({ asset, onDelete }: { asset: MediaAssetDto; onDelete: () => void }) {
function MediaRow({ asset, onDelete }: Readonly<{ asset: MediaAssetDto; onDelete: () => void }>) {
const { t } = useTranslation()
return (
<tr className="border-b border-border last:border-0">
@@ -3,7 +3,7 @@ import { AlertCircle, Check, ChevronDown, ChevronUp, Clock, Loader2, RotateCw, X
import { cn } from '@/shared/lib/cn'
import { type UploadItem, useUploadStore } from './upload-store'
function StatusIcon({ status }: { status: UploadItem['status'] }) {
function StatusIcon({ status }: Readonly<{ status: UploadItem['status'] }>) {
switch (status) {
case 'done':
return <Check className="h-3.5 w-3.5 shrink-0 text-primary" />
@@ -23,7 +23,10 @@ import { useUploadStore } from './upload-store'
/** Radix Select запрещает пустое значение — под «в библиотеку» используем спец-значение. */
const LIBRARY_VALUE = '__library__'
export function UploadToShowDialog({ files, onClose }: { files: File[]; onClose: () => void }) {
export function UploadToShowDialog({
files,
onClose,
}: Readonly<{ files: File[]; onClose: () => void }>) {
const { t } = useTranslation()
const enqueue = useUploadStore((s) => s.enqueue)
const [seasonStr, setSeasonStr] = useState('')