Files
github-stats-extended/apps/frontend/src/components/Home/StatsRankSection.tsx
T
Marco Pasqualetti 24907643ac feat(frontend): convert to ts (#37)
* feat(frontend): convert to ts

* refactor(frontend): axios-override - simplify shouldMock type

* fix: refine stage labels

* refactor(frontend): refine `useUserId` signature

* fix(frontend): descriptionLines and langsCount can be undefined

* refactor(frontend): refine casting on redirectCode

* refactor(frontend): refine stageIndex title and types

* refactor(frontend): apply pr review comments changes

* refactor(frontend): group properties using reference groups

* refactor(frontend): remove outdated comment

* fix(frontend): mock-http - simplify code
2026-01-29 09:42:25 +01:00

42 lines
1.0 KiB
TypeScript

import type { JSX } from "react";
import { Select } from "../Generic/Select";
import type { SelectOption } from "../Generic/Select";
import { Section } from "./Section";
export const DEFAULT_OPTION: SelectOption = {
id: 1,
label: "Rank",
value: "default",
disabled: false,
};
const options: Array<SelectOption> = [
DEFAULT_OPTION,
{ id: 2, label: "Percentile", value: "percentile", disabled: false },
{ id: 3, label: "GitHub", value: "github", disabled: false },
{ id: 4, label: "None", value: "default&hide_rank=true", disabled: false },
];
interface StatsRankSectionProps {
selectedOption: SelectOption;
onOptionChange: (option: SelectOption) => void;
}
export function StatsRankSection({
selectedOption,
onOptionChange,
}: StatsRankSectionProps): JSX.Element {
return (
<Section title="Progress Style">
<p>Select a progress style.</p>
<Select
options={options}
selectedOption={selectedOption || DEFAULT_OPTION}
onOptionChange={onOptionChange}
/>
</Section>
);
}