{#snippet columnVisibilityGroup( Group: typeof DropdownMenu.Group, GroupHeading: typeof DropdownMenu.GroupHeading, CheckboxItem: typeof DropdownMenu.CheckboxItem, Separator: typeof DropdownMenu.Separator, Item: typeof DropdownMenu.Item, )} Toggle columns {#each columns as col} {@const id = col.id!} {@const label = typeof col.header === "string" ? col.header : id} { columnVisibility = { ...columnVisibility, [id]: checked, }; }} class="relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer select-none outline-none data-highlighted:bg-accent data-highlighted:text-accent-foreground" > {#snippet children({ checked })} {#if checked} {/if} {label} {/snippet} {/each} {#if hasCustomVisibility} Reset to default {/if} {/snippet}
View {#snippet child({ wrapperProps, props, open })} {#if open}
{@render columnVisibilityGroup( DropdownMenu.Group, DropdownMenu.GroupHeading, DropdownMenu.CheckboxItem, DropdownMenu.Separator, DropdownMenu.Item, )}
{/if} {/snippet}
{#each table.getHeaderGroups() as headerGroup} {#each headerGroup.headers as header} {#if header.column.getIsVisible()} {/if} {/each} {/each} {#if loading && courses.length === 0} {#each Array(5) as _} {#each table.getVisibleLeafColumns() as col} {/each} {/each} {:else if courses.length === 0} {:else} {#each table.getRowModel().rows as row, i (row.id)} {@const course = row.original} toggleRow(course.crn)} > {#each row.getVisibleCells() as cell (cell.id)} {@const colId = cell.column.id} {#if colId === "crn"} {:else if colId === "course_code"} {@const subjectDesc = subjectMap[course.subject]} {:else if colId === "title"} {:else if colId === "instructor"} {@const primary = getPrimaryInstructor( course.instructors, )} {@const display = primaryInstructorDisplay(course)} {@const commaIdx = display.indexOf(", ")} {@const ratingData = primaryRating(course)} {:else if colId === "time"} {:else if colId === "location"} {@const concern = getDeliveryConcern(course)} {@const accentColor = concernAccentColor(concern)} {@const locTooltip = formatLocationTooltip(course)} {@const locDisplay = formatLocationDisplay(course)} {:else if colId === "seats"} {/if} {/each} {#if expandedCrn === course.crn} {/if} {/each} {/if}
{#if header.column.getCanSort()} {#if typeof header.column.columnDef.header === "string"} {header.column.columnDef .header} {:else} {/if} {#if header.column.getIsSorted() === "asc"} {:else if header.column.getIsSorted() === "desc"} {:else} {/if} {:else if typeof header.column.columnDef.header === "string"} {header.column.columnDef.header} {:else} {/if}
No courses found. Try adjusting your filters.
{course.subject} {course.courseNumber}{#if course.sequenceNumber}-{course.sequenceNumber}{/if} {course.title} {#if display === "Staff"} Staff {:else} {#if commaIdx !== -1} {display.slice( 0, commaIdx, )}, {display.slice( commaIdx + 1, )} {:else} {display} {/if} {/if} {#if ratingData} {@const lowConfidence = ratingData.count < RMP_CONFIDENCE_THRESHOLD} {ratingData.rating.toFixed( 1, )} {#if lowConfidence} {:else} {/if} {ratingData.rating.toFixed( 1, )}/5 · {ratingData.count} ratings {#if (ratingData.count ?? 0) < RMP_CONFIDENCE_THRESHOLD} (low) {/if} {#if ratingData.legacyId != null} · RMP {/if} {/if} {#if timeIsTBA(course)} TBA {:else} {@const mt = course.meetingTimes[0]} {#if !isMeetingTimeTBA(mt)} {formatMeetingDays( mt, )} {" "} {/if} {#if !isTimeTBA(mt)} {formatTimeRange( mt.begin_time, mt.end_time, )} {:else} TBA {/if} {#if course.meetingTimes.length > 1} +{course .meetingTimes .length - 1} {/if} {/if} {#if locTooltip} {locDisplay ?? "—"} {:else if locDisplay} {locDisplay} {:else} {/if} {#if openSeats(course) === 0}Full{:else}{openSeats( course, )} open{/if} {course.enrollment}/{course.maxEnrollment}{#if course.waitCount > 0} · WL {course.waitCount}/{course.waitCapacity}{/if}
{#snippet child({ wrapperProps, props, open })} {#if open}
{@render columnVisibilityGroup( ContextMenu.Group, ContextMenu.GroupHeading, ContextMenu.CheckboxItem, ContextMenu.Separator, ContextMenu.Item, )}
{/if} {/snippet}