mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-19 13:08:11 +02:00
feat: implement virtualized heatmap grid component using TanStack Table and Virtual for product data display.
This commit is contained in:
1 parent
aa77025d14
commit
cefe6060d0
1 file changed
+10
-4
@@ -51,10 +51,16 @@ function formatMonthLabel(key: string): string {
|
|||||||
* Returns premium styling and color for stores based on the store name's hash.
|
* Returns premium styling and color for stores based on the store name's hash.
|
||||||
* This guarantees a consistent color for a given store, regardless of its position in the list.
|
* This guarantees a consistent color for a given store, regardless of its position in the list.
|
||||||
*/
|
*/
|
||||||
|
const SITE_LABELS: Record<string, { label: string; nom: string }> = {
|
||||||
|
"292": { label: "F", nom: "Frouard (Nancy)" },
|
||||||
|
"579": { label: "H", nom: "Houdemont" },
|
||||||
|
};
|
||||||
|
|
||||||
function getStoreConfig(name: string) {
|
function getStoreConfig(name: string) {
|
||||||
const words = name.trim().split(/\s+/);
|
const known = SITE_LABELS[name];
|
||||||
let label = words[0].charAt(0).toUpperCase();
|
const words = (known?.nom ?? name).trim().split(/\s+/);
|
||||||
if (words.length > 1) {
|
let label = known?.label ?? words[0].charAt(0).toUpperCase();
|
||||||
|
if (!known && words.length > 1) {
|
||||||
label += words[1].charAt(0).toUpperCase();
|
label += words[1].charAt(0).toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +353,7 @@ export function HeatmapGrid({ onSelectionChange }: HeatmapGridProps) {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={magasin}
|
key={magasin}
|
||||||
title={`Travaillé par : ${magasin}`}
|
title={`Travaillé par : ${SITE_LABELS[magasin]?.nom ?? magasin}`}
|
||||||
className="px-1.5 py-0.5 rounded-md flex items-center gap-1 text-[10px] font-black border shadow-sm transition-transform hover:scale-110"
|
className="px-1.5 py-0.5 rounded-md flex items-center gap-1 text-[10px] font-black border shadow-sm transition-transform hover:scale-110"
|
||||||
style={{
|
style={{
|
||||||
background: config.bg,
|
background: config.bg,
|
||||||
|
|||||||
Reference in new issue
Block a user