Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { PageProps } from "$fresh/server.ts";
import translations from "../locales/es.json" with { type: "json" };
interface State {

interface FooterProps {
state: { lang: string; translations: typeof translations };
}
export default function Footer({ state }: PageProps<State>) {

export default function Footer({ state }: FooterProps) {
const { lang: _lang, translations } = state;
return (
<footer class="text-center text-xs w-full py-1 mt-10 mb-20">
{/* deno-lint-ignore react-no-danger */}
<div
class="py-1"
// deno-lint-ignore react-no-danger
dangerouslySetInnerHTML={{
__html: translations.index.footer.development,
}}
>
</div>
{/* deno-lint-ignore react-no-danger */}
<div
class="py-1"
// deno-lint-ignore react-no-danger
dangerouslySetInnerHTML={{
__html: translations.index.footer.created,
}}
Expand Down
20 changes: 12 additions & 8 deletions routes/[lang]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ import AnchorLang from "../../islands/AnchorLang.tsx";
import translations from "../../locales/es.json" with { type: "json" };
import { getLanguages } from "../../utils/global.ts";

export const handler: Handlers = {
interface MiddlewareState {
lang: string;
translations: typeof translations;
}

interface Data {
languages: string[];
}

export const handler: Handlers<Data, MiddlewareState> = {
async GET(_, ctx) {
const languages = await getLanguages(); // Obtén los lenguajes en el servidor
return ctx.render({ languages });
},
};

interface State {
state: { lang: string; translations: typeof translations };
languages: string[];
}

export default function Home({ state, data }: PageProps<State>) {
export default function Home({ state, data }: PageProps<Data, MiddlewareState>) {
const { lang, translations } = state;
const { languages } = data;
return (
Expand All @@ -43,8 +47,8 @@ export default function Home({ state, data }: PageProps<State>) {
<ul class="ml-6 list-disc col-span-full text-slate-800/90 dark:text-slate-200/80 text-pretty text-sm">
{section.items.map((item, index) => (
<li key={index}>
{/* deno-lint-ignore react-no-danger */}
<div
// deno-lint-ignore react-no-danger
dangerouslySetInnerHTML={{
__html: item,
}}
Expand Down
4 changes: 2 additions & 2 deletions routes/_404.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Head } from "$fresh/runtime.ts";
import { pageProps } from "$fresh/server.ts";
export default function Error404(_props: pageProps<{ message: string }>) {
import { PageProps } from "$fresh/server.ts";
export default function Error404(_props: PageProps<{ message: string }>) {
Comment on lines 1 to +3
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file’s change (fixing the $fresh/server.ts type import from pageProps to PageProps) is unrelated to the PR’s stated goal of fixing react-no-danger lint suppressions. Please either update the PR description to mention this additional fix, or split it into a separate PR to keep the scope focused.

Copilot uses AI. Check for mistakes.
return (
<>
<Head>
Expand Down
20 changes: 12 additions & 8 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ import AnchorLang from "../islands/AnchorLang.tsx";
import translations from "../locales/es.json" with { type: "json" };
import { getLanguages } from "../utils/global.ts";

export const handler: Handlers = {
interface MiddlewareState {
lang: string;
translations: typeof translations;
}

interface Data {
languages: string[];
}

export const handler: Handlers<Data, MiddlewareState> = {
async GET(_, ctx) {
const languages = await getLanguages(); // Obtén los lenguajes en el servidor
return ctx.render({ languages });
},
};

interface State {
state: { lang: string; translations: typeof translations };
languages: string[];
}

export default function Home({ state, data }: PageProps<State>) {
export default function Home({ state, data }: PageProps<Data, MiddlewareState>) {
const { lang, translations } = state;
const { languages } = data;
return (
Expand All @@ -42,8 +46,8 @@ export default function Home({ state, data }: PageProps<State>) {
<ul class="ml-6 list-disc col-span-full text-slate-800/90 dark:text-slate-200/80 text-pretty text-sm">
{section.items.map((item, index) => (
<li key={index}>
{/* deno-lint-ignore react-no-danger */}
<div
// deno-lint-ignore react-no-danger
dangerouslySetInnerHTML={{
__html: item,
}}
Expand Down
Loading