1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { Link } from "https://esm.sh/react-router-dom@6.20.1?deps=react@18.2.0";
4import { PostWithTags } from "../../shared/types.ts";
5
24
25 // Configure marked with syntax highlighting
26 React.useEffect(() => {
27 if (typeof marked !== 'undefined' && typeof hljs !== 'undefined') {
28 marked.setOptions({
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { Link } from "https://esm.sh/react-router-dom@6.20.1?deps=react@18.2.0";
4import { PostWithTags } from "../../shared/types.ts";
5
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { parseProject } from "https://esm.town/v/std/utils@85-main/index.ts";
4
5export function Footer() {
6 const currentYear = new Date().getFullYear();
7 const projectInfo = React.useMemo(() => {
8 try {
9 // This will only work on the server side
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { Link } from "https://esm.sh/react-router-dom@6.20.1?deps=react@18.2.0";
4
5export function Header() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { BrowserRouter, Routes, Route, useParams, Link, useNavigate } from "https://esm.sh/react-router-dom@6.20.1?deps=react@18.2.0";
5import { PostWithTags } from "../shared/types.ts";
6import { Header } from "./components/Header.tsx";
30// Home page component
31function Home() {
32 const [posts, setPosts] = React.useState<PostWithTags[]>([]);
33 const [loading, setLoading] = React.useState(true);
34 const [error, setError] = React.useState<string | null>(null);
35
36 React.useEffect(() => {
37 async function fetchPosts() {
38 try {
76function Post() {
77 const { slug } = useParams<{ slug: string }>();
78 const [post, setPost] = React.useState<PostWithTags | null>(null);
79 const [loading, setLoading] = React.useState(true);
80 const [error, setError] = React.useState<string | null>(null);
81 const navigate = useNavigate();
82
83 React.useEffect(() => {
84 async function fetchPost() {
85 if (!slug) return;
174 ],
175 'Biochemistry': [
176 { question: 'What is the main function of enzymes in the body?', options: ['To produce energy', 'To synthesize proteins', 'To catalyze chemical reactions', 'To store genetic information'], correct: 'To catalyze chemical reactions', explanation: 'Enzymes are biological molecules that catalyze chemical reactions in the body, allowing for the breakdown and synthesis of molecules.' },
177 { question: 'What is the difference between a saturated and an unsaturated fatty acid?', options: ['A saturated fatty acid has no double bonds, while an unsaturated fatty acid has one or more double bonds', 'A saturated fatty acid has one or more double bonds, while an unsaturated fatty acid has no double bonds', 'A saturated fatty acid is found only in animal products, while an unsaturated fatty acid is found only in plant products', 'A saturated fatty acid is found only in plant products, while an unsaturated fatty acid is found only in animal products'], correct: 'A saturated fatty acid has no double bonds, while an unsaturated fatty acid has one or more double bonds', explanation: 'Saturated fatty acids have no double bonds between the carbon atoms, while unsaturated fatty acids have one or more double bonds.' },
178 { question: 'What is the function of carbohydrates in the body?', options: ['To provide energy', 'To build and repair tissues', 'To regulate body functions', 'All of the above'], correct: 'All of the above', explanation: 'Carbohydrates have many functions in the body, including providing energy, building and repairing tissues, and regulating body functions.' },
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { App } from "./components/App.tsx";
4
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3import { LoginForm } from "./LoginForm.tsx";
4import { UserProfile } from "./UserProfile.tsx";
6
7- `index.html` - Main HTML template
8- `index.tsx` - Main React component and application entry point
9
10## Components
24## Technologies
25
26- React 18.2.0
27- TypeScript
28- Twind (Tailwind-in-JS)
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState } from "https://esm.sh/react@18.2.0";
3import { CommitWithPR } from "../../shared/types.ts";
4
35 <tbody className="bg-white divide-y divide-gray-200">
36 {commits.map((commit) => (
37 <React.Fragment key={commit.sha}>
38 <tr
39 className="hover:bg-gray-50 cursor-pointer"
121 </tr>
122 )}
123 </React.Fragment>
124 ))}
125 </tbody>