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.
This commit is contained in:
@@ -31,7 +31,7 @@ import { ViewerCard } from './components/ViewerCard'
|
||||
const TABS = ['settings', 'grid', 'rules', 'junctions', 'bumpers', 'viewer', 'air'] as const
|
||||
type ChannelTab = (typeof TABS)[number]
|
||||
|
||||
export function ChannelDetail({ channelId }: { channelId: string }) {
|
||||
export function ChannelDetail({ channelId }: Readonly<{ channelId: string }>) {
|
||||
const { t } = useTranslation()
|
||||
const queryClient = useQueryClient()
|
||||
const [applyOpen, setApplyOpen] = useState(false)
|
||||
@@ -52,7 +52,7 @@ export function ChannelDetail({ channelId }: { channelId: string }) {
|
||||
})
|
||||
const { data: schedule } = useQuery({
|
||||
queryKey: qk.channels.schedule(channelId),
|
||||
queryFn: () => getSchedule(channelId, new Date(), new Date(Date.now() + 12 * 3600_000)),
|
||||
queryFn: () => getSchedule(channelId, new Date(), new Date(Date.now() + 12 * 3_600_000)),
|
||||
})
|
||||
|
||||
const invalidate = () => {
|
||||
|
||||
Reference in New Issue
Block a user