) => {
e.preventDefault();
state.setLang(e.target.value);
};
return (
);
};
const Stack: ComponentType = () => {
const ctx = useTranslation();
return (
{ctx.languages.map(lang => (
))}
);
};
const loader = ({ src, width }: { src: string; width: number }) =>
`${src}/${width}/${Math.round((width * 9) / 16)}`;
const Block: ComponentType<
PageProps & { lang: string; state: LanguageState[] }
> = ({ greeting, message, info, nested, state }) => {
const counts = [0, 1, 1.5, 2, 3, 6, 42];
// Bake an alternative to
const Tli = tBind("li");
const Tdiv = tBind("div");
const Th2 = tBind("h2");
const Tp = tBind("p");
const TImage = tBind(Image);
const TBox = tBind(Box);
return (
s.lang)}>
{state.map(s => (
{" "}
))}
{/* inline fat string */}
{/* `info` has two placeholders which we fill with "one" and "two" */}
{/* translate alt attribute via cat tag */}
{/* many cats, many plurals */}
{counts.map((n, i) => (
{String(n)}
))}
);
};
const HomePage: NextPage = props => {
const state1 = useLanguageStates("de", "en", "fr");
const state2 = useLanguageStates("en", "de", "fr");
const state3 = useLanguageStates("fr", "de", "en-GB");
return (
);
};
export default HomePage;