* feat: add widget definition system * fix: wrong typecheck command in turbo generator * chore: fix formatting * feat: add widget preview page * chore: fix formatting and type errors * chore: fix from widget edit modal and remove some never casts * chore: address pull request feedback
34 lines
866 B
TypeScript
34 lines
866 B
TypeScript
import Image from "next/image";
|
|
|
|
import type { TitleOrder } from "@homarr/ui";
|
|
import { Group, Title } from "@homarr/ui";
|
|
|
|
interface LogoProps {
|
|
size: number;
|
|
}
|
|
|
|
export const Logo = ({ size = 60 }: LogoProps) => (
|
|
<Image src="/logo/homarr.png" alt="Homarr logo" width={size} height={size} />
|
|
);
|
|
|
|
const logoWithTitleSizes = {
|
|
lg: { logoSize: 48, titleOrder: 1 },
|
|
md: { logoSize: 32, titleOrder: 2 },
|
|
sm: { logoSize: 24, titleOrder: 3 },
|
|
} satisfies Record<string, { logoSize: number; titleOrder: TitleOrder }>;
|
|
|
|
interface LogoWithTitleProps {
|
|
size: keyof typeof logoWithTitleSizes;
|
|
}
|
|
|
|
export const LogoWithTitle = ({ size }: LogoWithTitleProps) => {
|
|
const { logoSize, titleOrder } = logoWithTitleSizes[size];
|
|
|
|
return (
|
|
<Group gap={0} wrap="nowrap">
|
|
<Logo size={logoSize} />
|
|
<Title order={titleOrder}>lparr</Title>
|
|
</Group>
|
|
);
|
|
};
|